Log in or register to post comments

Not able to add virtual buttons

September 23, 2012 - 5:28am #4

I am new to using vuforia. I was trying to add virtual buttons. I modified the dataset for the ImageTarget example as below.

Then when i test it i do not see any virtual buttons coming. (I did clean project ).


I tried to run the virtualbuttons project as well, here i can see the bouttons and yellow toepot. But when i click on the buttons i dont see

the color change for the pot.


Please help me to analyse and fix my issue. The posts in this forum is really helpful. Thanks a lot


xml version="1.0"



QCARConfig xmlns:xsi=



xsi:noNamespaceSchemaLocation="qcar_config.xsd" >










size="247 173" >









rectangle="-108.68 -53.52 -75.75 -65.87" />









rectangle="-45.28 -53.52 -12.35 -65.87" />









rectangle="14.82 -53.52 47.75 -65.87" />









size="247 173" />







Not able to add virtual buttons

September 24, 2012 - 10:53am #3

The buttons are invisible. They are simply a region of the image target, defined by their rectange, which will be analyzed to determine if the features in that rectangle are visible. If not, it is assumed that they are being occluded, and the button has been activated.

To test your VB's check the run session log for messages indicating that the button is being triggered.

Not able to add virtual buttons

September 24, 2012 - 11:29pm #2

Hi, Thank you very much for the reply .

I tried to touch the button assuming its position and found that button is getting triggered which confirms everything is fine.

But i have a question. In virtualButtons sample , i can see a small blank rectangle with white border coming on top of the actual button positions.

As i toggle this white border appear and disappears. How can i get this rectangle. I do not see anything other than creating / destrying the buttons. Then what is the magic

Not able to add virtual buttons

October 4, 2012 - 2:59pm #1

That border is drawn in VirtualButtons.cpp using a shader, see lines 454 - 471.


// Render frame around button

            glVertexAttribPointer(vbVertexHandle, 3, GL_FLOAT, GL_FALSE, 0,
                (const GLvoid*) &vbVertices[0]);


            glUniformMatrix4fv(mvpMatrixHandle, 1, GL_FALSE,
                (GLfloat*)&modelViewProjection.data[0] );

            // We multiply by 8 because that's the number of vertices per button
            // The reason is that GL_LINES considers only pairs. So some vertices
            // must be repeated.
            glDrawArrays(GL_LINES, 0, target->getNumVirtualButtons()*8);

            SampleUtils::checkGlError("VirtualButtons drawButton");


Log in or register to post comments