I'm just starting out with Blender and Blendswap. Recently, I downloaded a .blender file from Blendswap and wanted to incorporate it into my three.js scene. After exporting the Blender file as a .obj, I received both a .obj and a .mtl file. I then attempted to import it using the code below. Although there are no error messages, the rendering does not appear. Additionally, I was unsure of the appropriate command to set its position once imported (x, y, z) as I encountered issues with .position.set.
var santa;
var manager = new THREE.LoadingManager();
manager.onProgress = function ( item, loaded, total ) {
console.log( item, loaded, total );
};
var onProgress = function ( xhr ) {
if ( xhr.lengthComputable ) {
var percentComplete = xhr.loaded / xhr.total * 100;
console.log( Math.round(percentComplete, 2) + '% downloaded' );
}
};
var onError = function ( xhr ) {
console.log('Error: ' + xhr)
};
var loader = new THREE.OBJLoader( manager );
loader.load( 'img/santa blendswap.obj', function ( object ) {
santa = object;
scene.add( santa );
}, onProgress, onError );