1
我想設置臉部的顏色但失敗。如果我使用wireframe
,結果似乎是正確的。但是,如果不是,臉部似乎不會呈現。Three.js設置臉部顏色
var geo = new THREE.Geometry();
geo.vertices.push(new THREE.Vector3(1, 1, 0));
geo.vertices.push(new THREE.Vector3(1, 0, 0));
geo.vertices.push(new THREE.Vector3(0, 0, 0));
geo.faces.push(new THREE.Face3(0, 1, 2));
geo.faces[0].color = new THREE.Color('rgb(0,255,0)');
var mesh = new THREE.Mesh(geo, new THREE.MeshBasicMaterial({
vertexColors: THREE.FaceColors,
color: 0xff0000//,
//wireframe: true
}));
scene.add(mesh);
這裏的演示:http://jsfiddle.net/yaxpberz/。