When using the Object Loader in THREE.js to load a model of a tree, I have encountered an issue where no texture is loaded with it. Instead, it just appears as a simple tree with white light on it. The code I am using for this is:
var loader = new THREE.OBJMTLLoader();
loader.addEventListener('load', function (event) {
var object = event.content;
object.position.y = 0;
object.position.x = 500;
object.position.z = 500;
object.rotation.x = -(Math.PI / 2);
object.scale.set(5, 5, 2);
scene.add(object);
});
loader.load('obj/Palm_Tree.obj', 'obj/Palm_Tree.mtl');
I am seeking guidance on how to properly load the tree texture along with the model.