I'm struggling to properly apply a texture to an object I exported. Here is the code I have:
var loader = new THREE.ObjectLoader();
var texture = THREE.ImageUtils.loadTexture('models/mountain/mountain.png');
loader.load("models/mountain/mountain.json", function (obj) {
var material = new THREE.MeshPhongMaterial({
map: texture
});
mesh = new THREE.Mesh( obj, material );
scene.add( mesh );
});
Just placing the obj in the scene works fine, but when attempting to set a mesh and texture, an error arises. What should be the correct syntax for this scenario?