我在Three.js场景中创建了一个粒子系统。 这是我的代码。
function createParticleSystem() {
var sphere = new THREE.SphereGeometry(20, 50, 50);
var particleMaterial = new THREE.PointsMaterial({
color: 0xffffff,
size: 0.5,
map: THREE.ImageUtils.loadTexture("images/particle.png"),
blending: THREE.AdditiveBlending,
transparent: true,
opacity:1
});
particleSystem = new THREE.Points(sphere, particleMaterial);
return particleSystem;
}
将particleSystem添加到场景
particleSystem = createParticleSystem();
scene.add(particleSystem);
我想知道如何更改顶点的顶点的不透明度.y> 0?
for (var i; i<particleSystem.geometry.vertices.length; i++){
if(particleSystem.geometry.vertices[i].y > 0){
//
// I don't know how set the opacity of those vertices
//
}
}