Schemaphic Systems Blog

Sharing experiences in Flash, Flex and AIR

Archive for the ‘FLARToolkit’ Category

Augmented Reality using FLARToolkit – restrict unnecessary model jumping

with 8 comments

I have used FLARToolkit for many Augmented Reality projects.
At one point I felt that while holding the marker in a particular position, makes the 3D model appear and moves continuously even though the marker is still. After much debugging, I found out that this was happening due to light-shade change. To eliminate this sensitive issue in tracking lighting environment, I tried to restrict the renderViewport based on web-camera’s activity level. A level of 16 worked ideal for me. Check it out here:

//function called on enter frame
function renderViewport(event:Event):void
{
updateCaptureBitmap();// draws the web-camera image constantly
try{
//checks for marker existence using ARDetector
if (arDetector.detectMarker()) {
//restricts model form movement due to light change
if(arCamera.activityLevel > 16){
this.arDetector.calculateTransformMatrix(resultMatrix);
baseNode.setTransformMatrix(resultMatrix);
}
}else{
//do nothing
}
}catch(error:Error) {
trace(error);
}
renderer.renderScene(scene, camera, viewport); // renders model
}

Advertisements

Written by Deepanjan Das

July 8, 2010 at 9:17 PM