如何更改three.js中的某些顶点不透明度?

时间:2016-08-19 12:19:45

标签: javascript colors three.js vertices

我在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 
        //

        }
    }

0 个答案:

没有答案
相关问题