title: set the model on the center of the scene in threejs
body: <p>am using the following code to visualize the object on the center of the scene, it is working fine for the json loder, if we use <code>OBJLoder</code> or <code>OBJMTLloder</code> it is not working</p>
  
  <pre><code>function modelLoadedCallback(geometry, materials) {
  
      /* create the object from the geometry and materials that were loaded.  There
         can be multiple materials, which can be applied to the object using MeshFaceMaterials.
         Note tha the material can include references to texture images might finish
         loading later. */
  
      var object = new THREE.Mesh(geometry, new THREE.MeshFaceMaterial(materials));
  
      /* Determine the ranges of x, y, and z in the vertices of the geometry. */
  
      var xmin = Infinity;
      var xmax = -Infinity;
      var ymin = Infinity;
      var ymax = -Infinity;
      var zmin = Infinity;
      var zmax = -Infinity;
      for (var i = 0; i &lt; geometry.vertices.length; i++) {
          var v = geometry.vertices[i];
          if (v.x &lt; xmin)
              xmin = v.x;
          else if (v.x &gt; xmax)
              xmax = v.x;
          if (v.y &lt; ymin)
              ymin = v.y;
          else if (v.y &gt; ymax)
              ymax = v.y;
          if (v.z &lt; zmin)
              zmin = v.z;
          else if (v.z &gt; zmax)
              zmax = v.z;
      }
  
      /* translate the center of the object to the origin */
      var centerX = (xmin+xmax)/2;
      var centerY = (ymin+ymax)/2; 
      var centerZ = (zmin+zmax)/2;
      var max = Math.max(centerX - xmin, xmax - centerX);
      max = Math.max(max, Math.max(centerY - ymin, ymax - centerY) );
      max = Math.max(max, Math.max(centerZ - zmin, zmax - centerZ) );
      var scale = 10/max;
      object.position.set( -centerX, -centerY, -centerZ );
      console.log("Loading finished, scaling object by " + scale);
      console.log("Center at ( " + centerX + ", " + centerY + ", " + centerZ + " )");
  
      /* Create the wrapper, model, to scale and rotate the object. */
  
      model = new THREE.Object3D();
      model.add(object);
      model.scale.set(scale,scale,scale);
      rotateX = rotateY = 0;
      scene.add(model);
      render();
  
  }
  </code></pre>
  
  <p>it causing <code>TypeError: s is undefined</code>, so my model is not showing on the scene, what is wrong here?? there is any other method avail to center the object with <code>OBJLoder</code> or <code>OBJMTLloder</code></p>