Hi all,
I'm a chemistry teacher and I would like to use the JSARToolkit demo written by Ilmari Heikkinen in html5 rocks http://www.html5rocks.com/en/tutorials/webgl/jsartoolkit_webrtc/.
I'm a trying to use the threejs demo http://www.html5rocks.com/en/tutorials/webgl/jsartoolkit_webrtc/AR_mediaStream_three.html with the latest threejs
revision (n°58), adding a molecule mesh exported via blender with the three.js
exporter(ver2.6).
Here's my code used to import the mesh.
function addModelToScene( geometry, materials )
{
var material = new THREE.MeshFaceMaterial( materials );
mesh = new THREE.Mesh( geometry, material );
mesh.rotation.x = 2*Math.PI/2;
mesh.rotation.y = 2*Math.PI/2;
mesh.rotation.z = 2*Math.PI/2;
mesh.position.x = 0;
mesh.position.y = 0;
mesh.position.z = -50;
mesh.scale.set(30, 30, 30);
m.model.matrixAutoUpdate=false;
m.model.add(mesh);
scene.add(m.model);
}
for(var i in markers){var m=markers[i];
if(!m.model){m.model=new THREE.Object3D();
var jsonLoader = new THREE.JSONLoader();
jsonLoader.load( "models/eau.js", addModelToScene );
}
copyMatrix(m.transform,tmp);
m.model.matrix.setFromArray(tmp);
m.model.matrixWorldNeedsUpdate=true;
}
And here is the 3d model eau.js
I'm using:https://gist.github.com/BenjaminABEL/5899604/raw/3c73e7561b82493d982bdb54be81180e4f331a48/eau.js
The problem is that the molecule appears transparent-like and black.
Although this model works right when I import it like in a simpler example like this one:https://github.com/stemkoski/stemkoski.github.com/blob/master/Three.js/Model.html.