I am trying to add a texture to my obj file but encountering an error message. Below is the snippet of code I'm using:
new THREE.MTLLoader()
.setPath( 'models/cool' )
.load( 'CobbleStones.mtl', function ( mat ) {
mat.preload();
var loader = new THREE.OBJLoader( loadingManager );
loader.load( 'models/cool.obj', function ( object ) {
object.traverse( function ( child ) {
if ( child instanceof THREE.Mesh ) {
child.material = gemBackMaterial;
child.material = material;
loader.setMaterials(mat);
var second = child.clone();
second.material = gemFrontMaterial;
var parent = new THREE.Group();
parent.add( second );
parent.add( child );
scene.add( parent );
objects.push( parent );
}
} );
} );
});
The error message reads as follows:
GET http://localhost/alpha/Alpha/models/coolCobbleStones.mtl 404 (Not Found)
If anyone could provide assistance with this issue, I would greatly appreciate it.