I create a particle system in Three.js scene. Here is my code.
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;
}
add particleSystem to scene
particleSystem = createParticleSystem();
scene.add(particleSystem);
I wonder how could I change the opacity of vertices that vertices.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
//
}
}