My first attempt at using three.js involves loading a 3D model, but I'm encountering an issue with texture loading.
loader.load('models/asteroid_OBJ/asteroid OBJ.js', function (geometry, materials) {
var material = new THREE.MeshLambertMaterial({
//map: THREE.ImageUtils.loadTexture('models/asteroid_OBJ/Map__4_Mix.tga'),
//map: THREE.ImageUtils.loadTexture('models/asteroid_OBJ/Map__12_Cellular.tga'),
//map: THREE.ImageUtils.loadTexture('models/asteroid_OBJ/Map__15_Noise.tga'),
colorAmbient: [0.480000026226044, 0.480000026226044, 0.480000026226044],
colorDiffuse: [0.480000026226044, 0.480000026226044, 0.480000026226044],
colorSpecular: [0.8999999761581421, 0.8999999761581421, 0.8999999761581421]
});
When I remove the loadTextures code, the image loads correctly and functions well. However, keeping it leads to the image not appearing. Additionally, an error message is displayed regardless of the outcome:
GET http://localhost:8080/models/asteroid_OBJ/-bm%200.800000%20Map__4_Mix.tga 404 (Not Found)
It seems like the textures are in the right directory alongside asteroid OBJ.js
.