I have obj model which has mtl file with multiple texture.
but i cant load file with texture.
var OBJFile = 'assests/textured_model/geomodel.obj'
var MTLFile = 'geomodel.mtl';
const mtlLoader = new MTLLoader();
// mtlLoader.setBaseUrl('assests/textured_model/');
mtlLoader.setPath('assests/textured_model/');
mtlLoader.load(MTLFile, (mtl) => {
mtl.preload();
const objLoader = new OBJLoader();
console.log(mtl);
objLoader.setMaterials(mtl);
scene.add(new THREE.AmbientLight(0x404040))
objLoader.load(OBJFile, (root) => {
scene.add(root);
root.children.forEach((e) => {
e.geometry.computeVertexNormals()
console.log("completed");
})
});
});
geomodel.mtl (1.6 KB)