I have an OBJ file produced in Blender, along with associated MTL and some textures.
I then load the model + material with OBJLoader + MTLLoader respectively, but the result is not what I would expect.
The model is showing as transparent, even though I can see no reason why it would.
Other models I’ve made have shown up fine. The only difference I can think of with this one is that it was originally imported into Blender from an SKP file using an addon.
Pic in threejs:
All relevant files attached here:
TIMBERfinal.zip (55.6 KB)
Code:
const mtlLoader = new MTLLoader();
mtlLoader.setMaterialOptions({side: THREE.DoubleSide, shading: THREE.FlatShading});
mtlLoader.load('someaddress.com'+accountName+"/"+modelName+".mtl",
(materials) => {
materials.preload();
const objLoader = new OBJLoader();
objLoader.setMaterials(materials);
objLoader.load(
'someaddress.com'+accountName+"/"+modelName+".obj",
(object) => {
scene.add(object);
object.scale.set(1,1,1);
},
(xhr) => {
console.log((xhr.loaded / xhr.total * 100) + '% loaded');
},
(error) => {
console.log('An error happened');
}
);
},
(xhr) => {
console.log((xhr.loaded / xhr.total * 100) + '% loaded');
},
(error) => {
console.log('An error happened');
}
)