I am facing an issue while attempting to load an mtl file with reference to png textures for my obj model. The error I am encountering is as follows:
TypeError: manager.getHandler is not a function
Below is the snippet of my three.js code:
var loadOBJ = function(){
var mtlLoader = new THREE.MTLLoader();
mtlLoader.load( "static/pictures/3D/untitled2.mtl", function( materials ) {
materials.preload();
console.log(materials);
var loader = new THREE.OBJLoader( );
loader.load( "static/pictures/3D/jaw.obj", addModelInScene);});
};
var addModelInScene = function(object){
model = object;
model.rotation.y = 1.55;
scene.add(model);
render();
};
Additionally, here is the content of the .mtl file:
newmtl Teeth_UDIM
Ns 255.999998
Ka 1.000000 1.000000 1.000000
Kd 0.480000 0.424000 0.480000
Ks 0.040000 0.040000 0.040000
Ni 1.000000
d 1.000000
illum 2
map_Kd mrm.png
The mrm.png file is located in the same directory as the .mtl and .obj files. When I remove the last line from the .mtl file (map_Kd mrm.png), the error disappears, but the textures are also no longer displaying. Am I missing something in my approach?