2

I have a threejs JSON object file generated from obj and mtl file using python convertor. I am loading this js file using following code:

loader = new THREE.JSONLoader();
            loader.load('3bhk_1635_perpsective/test.js', function (geometry, materials ) {

                var mesh = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial( materials ) );
                geometry.computeFaceNormals();                  
                scene.add(mesh);
                }
            );

Everything is loading except the images associated with the JSONObject. Please help me load all the images.

  • possible duplicate of [using three.js JSONLoader](http://stackoverflow.com/questions/13655092/using-three-js-jsonloader) – Luca Davanzo Jul 28 '14 at 13:34

1 Answers1

0

If loader gives you no error, try to adjust object position and camera position.

Otherwise you are adding the mesh to the scene before the model finishes loading.
Move add in the callback:

loader.onLoadComplete = function() {
    scene.add(mesh);
}
Luca Davanzo
  • 21,000
  • 15
  • 120
  • 146