i try to make object to be more trackable.
any good solution???
after lost the target, how can I keep the lost target position? so I can display object in same perspective as before..
When QCAR detects a trackable it estimates the relative position of the target with respect to the view and computes a 3D matrix for you to position your 3D object. This is the pose matrix.
This, combined with the projection matrix (which repesents your viewport into the 3D world) will give you the absolute matrix for display.
Here's the code from EAGLView:renderFrameQCAR for getting the pose after detection/tracking:
const QCAR::Trackable* trackable = state.getActiveTrackable(i); QCAR::Matrix44F modelViewMatrix = QCAR::Tool::convertPose2GLMatrix(trackable->getPose());
And, for OpenGL ES 1.1, here's how the pose matrix is used:
// Load the projection matrix glMatrixMode(GL_PROJECTION); glLoadMatrixf(qUtils.projectionMatrix.data); // Load the model-view matrix glMatrixMode(GL_MODELVIEW); glLoadMatrixf(modelViewMatrix.data);
There are a number of things you can do depending on the user exeprience required.
1) Just retain a copy of the poseMatrix to freeze the augmentation where it last appeared during tracking
2) Keep a running average of the pose matrix to dampen the movement and smooth between short losses of the target.
3) Implement an animation that the poseMatrix influences, so the object has a life of its own, following the poseMatrix when it is available. The object could always return to a docking position in the camera view or just float to a standstill, or return to a point in the 3D world.
Are you sure you want to delete this message?
Are you sure you want to delete this conversation?