I want to load an object with different textures on different places - so I looked at the examples provided by three.js at https://threejs.org/examples/webgl_loader_obj_mtl.html. The object is getting loaded but it has no different textures on it.
This is the code I typed:
// LOAD TREE Example
var mtlLoader = new THREE.MTLLoader();
mtlLoader.setPath("Assets/Objects/Tree_V9_OBJ/");
mtlLoader.load("Tree_V9_Final.mtl", function(materials){
materials.preload();
console.log(materials);
var objLoader = new THREE.OBJLoader();
objLoader.setMaterials(materials);
objLoader.setPath('Assets/Objects/Tree_V9_OBJ/');
objLoader.load('Tree_V9_Final.obj', function(object){
console.log(object);
object.scale.x = 10;
object.scale.y = 10;
object.scale.z = 10;
scene.add(object);
});
});
My folder structure:
The result:
The console output
The Source of the object:
http://tf3dm.com/3d-model/tree-for-modification-v9-16618.html
I'm new to three.js so I don't know where I have to search for the bug.
There is no error thrown in the console.
How can I fix this so the object is getting loaded correctly with the textures?