I am trying to import an external model to one of the official ARToolKit projects using three.js. The project I'm using is the "pattern_threejs.html", and can be found here: https://github.com/artoolkit/jsartoolkit5
So far I have only managed to change the original sphere to display a cude instead when the marker is detected. The model I'm trying to import is an .fbx model, but I converted it into both Collada and JSON models using Blender. I tried several methods to import it, but everytime I try to do it, nothing appears when the marker is shown to the camera. Collada code:
var loader = new THREE.ColladaLoader();
loader.options.convertUpAxis = true;
loader.load( 'pump.dae', function ( collada ) {
var object = collada.scene;
object.scale.set( 1, 1, 1 );
object.position.set( 0, 0, 0.5
} );
arController.loadMarker('Data/patt.hiro', function(markerId) {
var markerRoot = arController.createThreeMarker(markerId);
markerRoot.add(loader);
arScene.scene.add(markerRoot);
});
JSON code:
arController.loadMarker('Data/patt.hiro', function(markerId) {
var markerRoot = arController.createThreeMarker(markerId);
var loader = new THREE.JSONLoader();
loader.load( 'pump.json', function ( geometry, materials ) {
var mesh = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial( materials ) );
markerRoot.add(loader);
});
arScene.scene.add(markerRoot);
});
Any suggestions? Would be a great help! Thanks!