-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Closed
Labels
Description
Hallo,
Since the materials array is deprecated, how might one assign a different material to each face? Let's do a simple cube example.
var materialA= new THREE.MeshLambertMaterial({color: 0x00ffaa });
cursorBox = new THREE.CubeGeometry(1, 1, 1);
cubeMesh = new THREE.Mesh(cursorBox, materialA);
// how I might have assigned materialB to face 1 prior to the change? Not sure.
var materialB = new THREE.MeshLambertMaterial({color: 0xff0000 });
mesh.materials.push( materialB);
cubeMesh.goemetry.faces[0].materialIndex = 1;
// my theory on how to do it now. It causes no error but fails to change anything.
// Waited for one render cycle to pass in case the material/geometry needs to bind
cubeMesh.geometry.faces[0].material = materialB ; Any ideas? I may just be missing something fundamentally simple. I'm using a dev build 036caa6.