myColladaLoader = new THREE.ColladaLoader();
myColladaLoader.options.convertUpAxis = true;
myColladaLoader.load( 'car.dae', function ( collada ) {
// Her the dae in a global variable.
myDaeFile = collada.scene;
// Position your model in the scene (world space).
myDaeFile.position.x = 0;
myDaeFile.position.y = 5;
myDaeFile.position.z = 0;
// Scale your model to the correct size.
myDaeFile.scale.x = myDaeFile.scale.y = myDaeFile.scale.z = 0.2;
myDaeFile.updateMatrix();
// Add the model to the scene.
scene.add( myDaeFile );
} );
}
Hello, I'm trying to create a game using models I've exported from 3dsMax. This code wont allow me to import my model for some reason? I've read through the documentation, and also tried it this way:
var loader = new THREE.ColladaLoader();
loader.load(
// resource URL
'car.dae',
// Function when resource is loaded
function ( collada ) {
scene.add( collada.scene );
},
// Function called when download progresses
function ( xhr ) {
console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
}
);
Directly from the documentation. I'm very new to this sort of stuff so please give me guidance! Also, I've tried to use other models that 100% are exported properly so its the code. Not the models.
Thanks for any advice and guidance.