Three.js r71:Point Cloud转换为Mesh并持续到STL

时间:2015-06-15 16:46:26

标签: javascript stl three.js

我有一个303 360粒子的云,它是用带有xyz位置的Vector3创建的,我怎样才能将粒子/点云作为一个封闭的对象传递,然后正确导出到STL?

我将three.min.jsTHREE.PointCloud(particles, material)

一起使用

http://threejs.org/docs/#Reference/Objects/PointCloud

我使用的部分代码是:

material = new THREE.ShaderMaterial( { 
    attributes: attributes,
    uniforms: uniforms,
    vertexShader: shaderCache.vertex,
    fragmentShader: shaderCache.fragment,
    depthWrite: true
});

particles = new THREE.Geometry();

for (y = 0; 0 <= h ? y < h : y > h; 0 <= h ? y++ : y--) {
    for (x = 0; 0 <= w ? x < w : x > w; 0 <= w ? x++ : x--) {
        xc = (x - (w / 2)) * useEvery * 1;
        yc = ((h / 2) - y) * useEvery * 1;
        particle = v(xc, yc, 0);
        particle.usualY = yc;
        particles.vertices.push(particle);
    }
}

particleSystem = new THREE.PointCloud( particles, material );
scene.add(particleSystem);

0 个答案:

没有答案