Hi guys, I am starting to learn this awesome library and I am totally in love. I followed a couple of tutorials and managed to import my 3d model (obj extension) just fine.
But when I want to import the .mtl file as well, nothing happens just a black screen.
Could anyone please explain me what I am doing wrong?
working code (without materials):
loader.load(
'scene.obj',
function ( object ) {
scene.add( object );
},
function ( xhr ) {
console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );
},
function ( error ) {
console.log( 'An error happened' );
}
);
Code that is not working:
let materialLoader = new THREE.MTLLoader();
materialLoader.load('scene.mtl', function(materials){
materials.preload();
let objectLoader = new THREE.OBJLoader();
objectLoader.setMaterials(materials);
objectLoader.load('scene.obj', function(mesh){
scene.add(mesh);
});
});
Unfortunately, I do not receive any errors or warnings in my developers console, and thus I have no clue where to look.
I hope someone can help me out with this matter.
Best regards
P.S. Link to my code: http://159.69.213.164/3d/