Log in or register to post comments

how to flip camera feed

May 31, 2011 - 10:45pm #1

hi

have a small requirement as when the marker is shown the 3d image popups and when it is removed a different action should take place, but how to know marker is removed.

Re: how to flip camera feed

June 2, 2011 - 2:01am #5

You would have to add the code to call a java method...

jclass javaClass = env->GetObjectClass(obj);
jmethodID myJavaMethod = env->GetMethodID(javaClass, "myMethod", "()V");
env->CallVoidMethod(obj, myJavaMethod);

Re: how to flip camera feed

June 1, 2011 - 6:12pm #4

will this code trigger java code when ever marker is shown and removed from the camera.

Re: how to flip camera feed

June 1, 2011 - 7:15am #3

Yep, or if you have multiple markers you can keep track of the current status for each one, and take action when the status changes. Instead of this:

for(int tIdx = 0; tIdx < state.getNumActiveTrackables(); tIdx++)
{
    const QCAR::Trackable* trackable = state.getActiveTrackable(tIdx);
    ...
}

You could use this:

for(int tIdx = 0; tIdx < state.getNumTrackables(); tIdx++)
{
    const QCAR::Trackable* trackable = state.getTrackable(tIdx);
    QCAR::Trackable::STATUS status = trackable->getStatus();
    // store status information for each trackable each frame
    // compare with previous status for this trackable
    ...
}

- Kim

Re: how to flip camera feed

June 1, 2011 - 1:38am #2

QCAR::State state = QCAR::Renderer::getInstance().begin();

if (state.getNumActiveTrackables() //...do stuff...
}

I did something like that.

Log in or register to post comments