I'm trying to load a simple car model that is separated into tires, body and windows into three.js, I use Blender to export as .json
but when I use the JSONloader it only loads the body.
So then I try to export it as scene, but when I use the JSONloader nothing show up in the scene.
So I have two questions:
- What is the proper way to export and load a multi part model from Blender JSON?
- How do I load a JSON scene exported from Blender into three.js?
Following @larsenhupin suggestion heres my try with objectloader, however the scene doesn't show
//LOAD A JSON SCENE
var loader = new THREE.ObjectLoader();
loader.load(
// resource URL
"models/stockcarb.json"
// pass the loaded data to the onLoad function.
//Here it is assumed to be an object
function ( obj ) {
//add the loaded object to the scene
scene.add( obj );
},
// Function called when download progresses
function ( xhr ) {
console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
},
// Function called when download errors
function ( xhr ) {
console.error( 'An error happened' );
}
);