我有一个303 360粒子的云,它是用带有xyz位置的Vector3创建的,我怎样才能将粒子/点云作为一个封闭的对象传递,然后正确导出到STL?
我将three.min.js
与THREE.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);