现在,我用three.js
开发一个3d沙发价格计算器
在这里,我将 3ds文件加载到场景中。
但是我有这样的问题。
如上图所示,我无法显示正确的纹理。 因此,我尝试在3DS Max中更新UVW信息。
但是结果在图像下方 这是我的代码
//load textures
var textureImage;
var bumpImage;
var diffuse = new THREE.TextureLoader().load(
'texture/'+texture+'.jpg',
function(texture){
textureImage = texture;
},
null,
function(err){
console.log('failed')
}
);
var bump = new THREE.TextureLoader().load(
'texture/'+texture+'-bump.jpg',
function(texture){
bumpImage = texture;
},
null,
function(err){
console.log('failed')
}
);
setTimeout(() => {
var material = new THREE.MeshStandardMaterial({
map : textureImage,
bumpMap : bumpImage,
// metalness : 0.3,
// roughness : 0.3,
})
console.log(material)
for(var i in lstElement){
var item = lstElement[i].model;
for(var j in item.children){
item.children[j].material = material;
}
}
}, 500);
我不知道为什么我不能显示正确的纹理。