I am very new to three.js. I was tried to load a 3D model using class. But it is not loading my 3D model. My console is not showing any errors and I am able to see the grid that I have created.
Here is My code
renderCam()
{
this.renderer = new THREE.WebGLRenderer( { antialias: true } );
this.renderer.setPixelRatio( window.devicePixelRatio );
this.renderer.setSize( this.container.clientWidth, this.container.clientHeight );
this.renderer.shadowMap.enabled = true;
this.container.appendChild( this.renderer.domElement );
this.controls= new THREE.OrbitControls(this.camera,this.renderer.domElement);
this.controls.update();
}
//Here is the script for loading my 3D object
loadModel()
{
this.loader = new THREE.FBXLoader();
console.log("done")
this.loader.load('assets/jasper.fbx', function(object){
console.log("Here");
});
this.scene.add(object);
}
animate()
{
const game = this;
requestAnimationFrame(function(){game.animate();});
this.renderer.render(this.scene,this.camera);
}
}