THREE.DecalGeometry(转载)

 function getDecalGeometry(position, direction){
    var decalGeometry = new THREE.DecalGeometry(  
        earthMesh, // it has to be a THREE.Mesh
        position, // THREE.Vector3 in world coordinates  
        direction, // THREE.Vector3 specifying the orientation of the decal  
        new THREE.Vector3(25,25,25), // THREE.Vector3 specifying the size of the decal box  
        new THREE.Vector3(1,1,1) // THREE.Vector3 specifying what sides to clip (1-clip, 0-noclip)  
    );
    return decalGeometry;
}

function getDecalMaterial(){
    var decalMaterial = new THREE.MeshLambertMaterial( {
        map: THREE.ImageUtils.loadTexture( 'img/hotspot.png' ), 
        transparent: true, 
        depthTest: true,
        depthWrite: false,
        polygonOffset: true,
        polygonOffsetFactor: -4,
    });
    return decalMaterial;
}

 

posted @ 2016-08-24 14:30  琐碎之人  阅读(328)  评论(0编辑  收藏  举报