How to load a model in .json in three.js I need to load a model "somemodel.json" into my "movie.js".Can someone tell me where i am going wrong.I followed the steps given here.

index.html

&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
         &lt;meta charset=utf-8&gt;
         &lt;title&gt;Test&lt;/title&gt;
         &lt;style&gt;
            body { margin: 0; }
            canvas { width: 100%; height: 100% }
         &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;script src="three.min.js"&gt;&lt;/script&gt;
        &lt;script src="ObjectLoader.js"&gt;&lt;/script&gt;
        &lt;script src="movie.js"&gt;&lt;/script&gt;
    &lt;/body&gt;
&lt;/html&gt;


movie.js

var camera;
var scene;
var renderer;
var loader;

frame();
animate();

function frame() {

scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera( 45, window.innerWidth /     window.innerHeight, 0.1, 1000);
camera.position.y = 0;
camera.position.z = 10;
camera.rotation.x = 0;

var loader = new THREE.ObjectLoader();
loader.load(
'somemodel.json',
function () {
    var geometry = new THREE.SphereGeometry(3,32,32);
    var material = new THREE.MeshBasicMaterial();
    var object = new THREE.Mesh( geometry, material );
    scene.add( object );
}
);

renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
render();
}

function animate() {
render();
requestAnimationFrame( animate );
}

function render() {
renderer.render( scene, camera );
}


Or can your give an example with a sample model ?

When i run my file it raises an error in the console saying not well-formed        male.json
The error not well-formed        male.json doesn't appear to have anything to do with the code you've posted. I don't see any references to a JSON file called male.json.

If this file is in your code somewhere, the error is telling you the problem. It is malformed. Paste the contents of the file into an online validation tool such as JSONLint. It will tell you what is making it malformed.

Also, you're passing JSON into ObjectLoader.load but you don't do anything with the results. Instead try this:

var loader = new THREE.ObjectLoader();
loader.load('somemodel.json', function (object) {
    scene.add(object);
});


Check out the documentation for more information.