0
votes

I just follow this example: http://threejs.org/examples/webgl_loader_obj_mtl.html

But my object loads without texture. I used a .obj and a .mtl file generated by Blender. What can I do to apply a texture to this object in Three.js? Here is the object I want to load: http://tf3dm.com/3d-model/super-camputer-ibm-75503.html

How I load the object:

var loader = new THREE.OBJMTLLoader();
loader.load('obj/servidor.obj', 'obj/servidor.mtl', function(object) {

        object.position.y = -80;
        scene.add(object);

}, onProgress, onError);
1
We need some code.. question is too generic.. could be anything..Luca Davanzo
Now i added some code @VelthuneJose Miguel Vega Lopez
code seems ok, so problem could be on blender exporting. Generally, from what I just read, materials and textures should be "inside" mtl file.. so take a look here, maybe you simply have to set some scene/ambient paramenters stackoverflow.com/questions/24311026/…Luca Davanzo
My object does not load blank, it loads well but the texture is not applied. Here is my mtl file: pastie.org/10078588 @VelthuneJose Miguel Vega Lopez
What can i do to load the texture?Jose Miguel Vega Lopez

1 Answers

0
votes

The problem was that the texture was not included in MTL file. I applied the texture with blender and generated obj and mtl again, now Three.js loads the object with texture (the javascript code from the question is ok)