When I try to run both .obj and .mtl files together, I encounter an error, whereas running just the .obj loader works fine. The specific error message that appears is:
Below is the code snippet I am using to load the .obj and .mtl files:
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 );
});
});
Does anyone have any suggestions on how to resolve this issue?