I want to put a texture on my obj file, but I'm getting an error message. This is my code:
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 is:
GET http://localhost/alpha/Alpha/models/coolCobbleStones.mtl 404 (Not Found)
I would be very thankful if anybody could help me with my problem.