Object not loading when using MTLLoader

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/

Your material has just a black color, that’s all. You can easily see this if you set a white background like so:

scene.background = new THREE.Color( 0xffffff );

image
This happens because the following line in your MTL file results in a black color. It represents the diffuse reflectivity and is mapped to MeshPhongMaterial.color.

Kd 0.0000 0.0000 0.0000

I dont understand a word of what your saying hahaha… I will investigate, at least now I know something in the material is wrong :slight_smile:

It should be Red and green, exported with 3ds Max 2018. Ill try to figure out where it went wrong.

Fixed it by using scanline (instead of vray) now it is working but extremely fake, no shadows nothing haha but I guess that has to do with the lighting :smiley:

Thanks so much for your reply!