각면에 다른 물질을 할당 할 수 있습니다. 여기에 얼굴이 자료를 공유하는 예이지만, 일부면이 투명 : 런타임에 재료를 변경하는 방법 중 하나를 보여주는 바이올린 업데이트
// geometry
var geometry = new THREE.BoxGeometry(100, 100, 100, 4, 4, 4);
// materials
materials = [
new THREE.MeshLambertMaterial({ color: 0xffff00, side: THREE.DoubleSide }),
new THREE.MeshBasicMaterial({ transparent: true, opacity: 0 })
];
// assign material to each face
for(var i = 0; i < geometry.faces.length; i++) {
geometry.faces[ i ].materialIndex = THREE.Math.randInt(0, 1);
}
geometry.sortFacesByMaterialIndex(); // optional, to reduce draw calls
// mesh
mesh = new THREE.Mesh(geometry, materials);
scene.add(mesh);
: http://jsfiddle.net/e0x88z7w/
편집 : MeshFaceMaterial
가 사용되지 않습니다. 소식과 피들이 업데이트되었습니다.
three.js r.87
귀하의 질문은 명확하지 않습니다. 얼굴의 가시성을 false로 설정하려고합니까 (보이지 않게하십시오)? – frank
나는이 질문을 내가 이해하고있는 방식으로 편집했다. 특히이 질문을하고 중복을 만들고 싶지 않기 때문에 특히 그렇습니다. – Matthias