THREE.MeshFaceMaterial()
メッシュ全体に使用する必要があります。たとえば、geometry
X 面と 2 つの異なるマテリアルがある場合:
var materials = [
new THREE.MeshLambertMaterial( { color: 0xffffff, opacity: 0.6, depthWrite: false, depthTest: false, vertexColors: THREE.VertexColors } ),
new THREE.MeshLambertMaterial( { color: 0xffffff, opacity: 1, depthWrite: false, depthTest: false, vertexColors: THREE.VertexColors } )
]; // the two materials
var mesh = new THREE.Mesh(yourGeometry, new THREE.MeshFaceMaterial(materials)); //tell three.js that you will have several materials in your geometry
materialIndex
次に、マテリアル インデックスに基づいて、各面のマニュアルを決定する必要があります。
yourGeometry.faces[0].materialIndex = 0;
yourGeometry.faces[1].materialIndex = 0;
yourGeometry.faces[2].materialIndex = 1; // <= the cone base
...
yourGeometry.faces[lastFaceIndex].materialIndex = 0;
注意: のデフォルト パラメータは でmaterialIndex
ある0
ため、ケースではマテリアル インデックスに対して 1 つの面のみを決定する必要があります。