I want to run .obj file and .mtl file, but when I run only .obj loader it doesnt show any problem. Running objloader together with mtlloader it gives me an error:
Code that I use to load .obj and .mtl files is:
carLoad = new THREE.MTLLoader();
carLoad.load('assets/obj/audi/Audi_R8.mtl',function(materials){
materials.preload();
objLoader = new THREE.OBJLoader();
objLoader.setMaterials(materials)
objLoader.load( 'assets/obj/audi/Audi_R8.obj', function ( object ) {
object.position.set(-50, 0, -60);
scene.add( object );
});
});
Any idea how to fix this?