2
votes

Using r54:

cube and on each side a different texture.

var materials = [new THREE.MeshBasicMaterial({map: textureSmallSide}),
                 new THREE.MeshBasicMaterial({map: textureSmallSide}), 
                 new THREE.MeshBasicMaterial({map: textureSmallSide}),
                 new THREE.MeshBasicMaterial({map: textureSmallSide}),
                 new THREE.MeshBasicMaterial({map: texture}),
                 new THREE.MeshBasicMaterial({map: texture})];

so in this case 6 different canvas-obj

new THREE.Mesh(cuboidgeo, new THREE.MeshFaceMaterial(materials));

question:
how can I get the materials array to update these textures(e.g change values of the canvas-obj)? I know that when I create a mesh like that:

new THREE.Mesh(cubegeo, new THREE.MeshBasicMaterial({map: texture}));

I can get my canvas object like:

cubemeshobj.material.map.image

but who do I get the textures(material array) of THREE.MeshFaceMaterial ?

1

1 Answers

1
votes

Check your object in console. Now you have an array of materials

for(var i = 0; i < cubemeshobj.material.materials.length; i++){

      cubemeshobj.material.materials[i].map.image;

}

r56