Log in or register to post comments

can we load as our custom view while the targets get detected in videoplayback sample.

March 12, 2013 - 11:13pm #1

Hii.

I want to load my custom view after the image target is detectedinstaed of loading vuforia images with play icon. how can i achieve that. i dont want to play video, i want to just load a custom view if the image gets detected. Can i achieve it .?

can we load as our custom view while the targets get detected in

January 5, 2016 - 1:05am #10

the page is not availabl.. could you pls some other link

 

thank you

can we load as our custom view while the targets get detected in

September 30, 2013 - 2:20am #9

Hi Kasunw,

 

Pl. let me know what was useful. The link is missing in your mail. I would like to load a custom view after the object is detected.

How to achieve that pl. let me know.

 

 

can we load as our custom view while the targets get detected in

August 21, 2013 - 11:16pm #8

This was very helpfull .. thanks....

can we load as our custom view while the targets get detected in

March 13, 2013 - 11:13pm #7

Excelllent.

can we load as our custom view while the targets get detected in

March 13, 2013 - 11:09pm #6

Thanks AlessandroB. it was your help,now i am able to open new activity after detection of image target. :)

can we load as our custom view while the targets get detected in

March 13, 2013 - 5:08am #5

Hi,

that's because the article still refers to the 1.5 API;  so, you need to replace getNumActiveTrackables() with getNumTrackableResults() and also replace getActiveTrackable( tIdx) with getTrackableResult( tIdx ); essentially your "for loop" must be updated as shown here:

 for(int tIdx = 0; tIdx < state.getNumTrackableResults(); tIdx++)
    {
        // Get the trackable:
        const QCAR::TrackableResult* result = state.getTrackableResult(tIdx);
        const QCAR::Trackable& trackable = result->getTrackable();

 

Also, trackable->getName() must be replaced by trackable.getName(), and trackable->getId() must be replaced by trackable.getId()

 

can we load as our custom view while the targets get detected in

March 13, 2013 - 3:44am #4

i followed the link but i am getting the follwong error.

--------------------------------------------------------------------------------

C:\Developement\adt-bundle-windows\vuforia-sdk-android-2-0-29\samples\ImageTarge
ts-2-0-7>C:\Developement\adt-bundle-windows\android-ndk-r8c\ndk-build
"Compile++ arm  : ImageTargets <= ImageTargets.cpp
jni/ImageTargets.cpp: In function 'void Java_com_qualcomm_QCARSamples_ImageTarge
ts_ImageTargetsRenderer_renderFrame(JNIEnv*, jobject)':
jni/ImageTargets.cpp:345:34: error: 'class QCAR::State' has no member named 'get
NumActiveTrackables'
jni/ImageTargets.cpp:348:50: error: 'class QCAR::State' has no member named 'get
ActiveTrackable'
make: *** [obj/local/armeabi/objs/ImageTargets/ImageTargets.o] Error 1

----------------------------------------------------------------------------------------------------------

my renderframe method of cpp file is like this..

int lastTrackableId = -1;
JNIEXPORT void JNICALL
Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargetsRenderer_renderFrame(JNIEnv* env, jobject obj)
{
    //LOG("Java_com_qualcomm_QCARSamples_ImageTargets_GLRenderer_renderFrame");

    // Clear color and depth buffer
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    // Get the state from QCAR and mark the beginning of a rendering section
    QCAR::State state = QCAR::Renderer::getInstance().begin();

    // Explicitly render the Video Background
    QCAR::Renderer::getInstance().drawVideoBackground();

#ifdef USE_OPENGL_ES_1_1
    // Set GL11 flags:
    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_NORMAL_ARRAY);
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);

    glEnable(GL_TEXTURE_2D);
    glDisable(GL_LIGHTING);

#endif

    glEnable(GL_DEPTH_TEST);

    // We must detect if background reflection is active and adjust the culling direction.
    // If the reflection is active, this means the post matrix has been reflected as well,
    // therefore standard counter clockwise face culling will result in "inside out" models.
    glEnable(GL_CULL_FACE);
    glCullFace(GL_BACK);
    if(QCAR::Renderer::getInstance().getVideoBackgroundConfig().mReflection == QCAR::VIDEO_BACKGROUND_REFLECTION_ON)
        glFrontFace(GL_CW);  //Front camera
    else
        glFrontFace(GL_CCW);   //Back camera

    for(int tIdx = 0; tIdx<state.getNumActiveTrackables(); tIdx++)
    {
        // Get the trackable:
        const QCAR::Trackable* trackable = state.getActiveTrackable(tIdx);
        // Compare this trackable's id to a globally stored id
        // If this is a new trackable, find the displayMessage java method and
        // call it with the trackable's name
        if (trackable->getId() != lastTrackableId) {
            jstring js = env->NewStringUTF(trackable->getName());
            jclass javaClass = env->GetObjectClass(obj);
            jmethodID method = env->GetMethodID(javaClass, "displayMessage", "(Ljava/lang/String;)V");
            env->CallVoidMethod(obj, method, js);
            lastTrackableId = trackable->getId();
        }
    }

    glDisable(GL_DEPTH_TEST);

#ifdef USE_OPENGL_ES_1_1
    glDisable(GL_TEXTURE_2D);
    glDisableClientState(GL_VERTEX_ARRAY);
    glDisableClientState(GL_NORMAL_ARRAY);
    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
#else
    glDisableVertexAttribArray(vertexHandle);
    glDisableVertexAttribArray(normalHandle);
    glDisableVertexAttribArray(textureCoordHandle);
#endif

    QCAR::Renderer::getInstance().end();
}

 

what things i need to do more to make this working.?

can we load as our custom view while the targets get detected in

March 12, 2013 - 11:47pm #3

Okay thanks. I will follow this tutorial

can we load as our custom view while the targets get detected in

March 12, 2013 - 11:30pm #2
Log in or register to post comments