我是从JSON文件加载的3D包模型,现在我想在包的每个面上添加不同的图像。我的流程是
这是我的代码
var image;
var materials = [];
var loader = new THREE.JSONLoader();
loader.load("bag.json", function (model) {
for (var i=0; i<6; i++) {
image = (i+1)+".jpg";
materials.push(new THREE.MeshBasicMaterial( { map: new THREE.TextureLoader().load(image), overdraw: true}));
}
var materialSix = new THREE.MeshFaceMaterial(materials);
object = new THREE.Mesh(model, materialSix);
object.translateY(1);
object.scale = new THREE.Vector3(1, 1, 1);
scene.add(object);
});
但它只在所有脸上显示一张图像。我想在前面,后面,左边,右边添加图像。如何解决这个问题?