0
我的錐體顯示在jsfiddle鏈接中。現在整個錐體是單色的,是藍色的。但我想將圓錐體的底部顏色改爲紅色。爲此我需要改變形成Square底座的兩個面的顏色。怎麼做?如何改變Three.js中cone的基色的顏色?
的jsfiddle鏈接,我的錐形:http://jsfiddle.net/sagh0900/suvKg/1/
function getGeometry(meshMaterial)
{
var cone;
var geo = new THREE.Geometry();
geo.vertices.push(new THREE.Vector3(0, 0, 0));
geo.vertices.push(new THREE.Vector3(-0.5, 0.5, 1));
geo.vertices.push(new THREE.Vector3(0.5, 0.5, 1));
geo.vertices.push(new THREE.Vector3(-0.5, -0.5, 1));
geo.vertices.push(new THREE.Vector3(0.5, -0.5, 1));
geo.faces.push(new THREE.Face3(0,1,2));
geo.faces.push(new THREE.Face3(2,1,4));
geo.faces.push(new THREE.Face3(1,3,4));
geo.faces.push(new THREE.Face3(4,3,0));
geo.faces.push(new THREE.Face3(3,1,0));
geo.faces.push(new THREE.Face3(0,2,4));
geo.computeFaceNormals();
cone = new THREE.Mesh(geo, meshMaterial);
cone.doubleSided = true;
cone.overdraw = true;
return cube;
}
在此先感謝。