I'm trying to load a fairly complex .obj file into three.js. Here's the code:
// Load obj file
var loader = new THREE.OBJMTLLoader();
loader.load('MQ-9.obj', 'MQ-9.mtl', function(object) {
scene.add(object);
});
The MQ-9.mtl file refers to three images that are used on various places of the object (which is an MQ-9 Predator drone). I can load the object fine but its all black. The images don't appear to be loading. What am I doing wrong?
If you load a model and it renders black, there can be several possible causes, some of which include problems with your model. Make sure you have no console errors.
Other than that, the two most common causes are:
a lack of lights in the scene
rendering the scene before all assets load
three.js r.67