jeromeetienne / threex.webar

three.js extensions for Augmented Reality
http://jeromeetienne.github.io/threex.webar/examples/basic.html
313 stars 81 forks source link

Best way to translate the projection ? #6

Open enguerranws opened 8 years ago

enguerranws commented 8 years ago

Hi,

I'm currently using threex.webar on a project. It's working fine, so thank you very much, it makes using Aruco with Three.js a lot easier.

Right now, I'm trying to make a projection (markerObject3D) based on a marker, but I want it to be next to the marker, not on it.

Here's how I achieved that, using Three.js translatex() :

function render() {

    translateMarker3D(markerObject3D);
        movieMaterial.update();
        backgroundTexture.update();
        effect.render(scene, camera)
}
function translateMarker3D(marker3D) {
       marker3D.translateX( 80 );
}  

The thing is : it kinda work. It flickers a lot, when it's great without transition.

I also tried to change aruco's returning values (in threex.jsarucomarker.js):

object3d.position.x = translation[0];

But it renders the same, flickering.

So my question is: what is the best way to make a projection next to a marker?