three.js - THREE.MeshFaceMaterial更新多维数据集上的纹理

时间:2013-03-08 11:25:58

标签: three.js mesh cube material

使用r54:

立方体,每边都有不同的纹理。

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})];

所以在这种情况下6个不同的画布-obj

new THREE.Mesh(cuboidgeo, new THREE.MeshFaceMaterial(materials));
问题:
如何让材质数组更新这些纹理(例如更改canvas-obj的值)? 我知道当我创建这样的网格时:

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

我可以得到我的画布对象:

cubemeshobj.material.map.image

但是我从谁那里得到THREE.MeshFaceMaterial的纹理(材质数组)?

1 个答案:

答案 0 :(得分:1)

在控制台中检查您的对象。现在你有了一系列材料

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

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

}

R56