"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

vbvertice on Virtual Button sample

I wonder how the virtual button rendered on the screen?

why there's 96 vertices just to render 4 virtual button? 

yeah this particular code is really confuse me 

 

 // We add the vertices to a common array in order to have one single             // draw call. This is more efficient than having multiple glDrawArray calls            vbVertices[vbCounter   ]=vbRectangle->getLeftTopX();            vbVertices[vbCounter+ 1]=vbRectangle->getLeftTopY();            vbVertices[vbCounter+ 2]=0.0f;            vbVertices[vbCounter+ 3]=vbRectangle->getRightBottomX();            vbVertices[vbCounter+ 4]=vbRectangle->getLeftTopY();            vbVertices[vbCounter+ 5]=0.0f;            vbVertices[vbCounter+ 6]=vbRectangle->getRightBottomX();            vbVertices[vbCounter+ 7]=vbRectangle->getLeftTopY();            vbVertices[vbCounter+ 8]=0.0f;            vbVertices[vbCounter+ 9]=vbRectangle->getRightBottomX();            vbVertices[vbCounter+10]=vbRectangle->getRightBottomY();            vbVertices[vbCounter+11]=0.0f;            vbVertices[vbCounter+12]=vbRectangle->getRightBottomX();            vbVertices[vbCounter+13]=vbRectangle->getRightBottomY();            vbVertices[vbCounter+14]=0.0f;            vbVertices[vbCounter+15]=vbRectangle->getLeftTopX();            vbVertices[vbCounter+16]=vbRectangle->getRightBottomY();            vbVertices[vbCounter+17]=0.0f;            vbVertices[vbCounter+18]=vbRectangle->getLeftTopX();            vbVertices[vbCounter+19]=vbRectangle->getRightBottomY();            vbVertices[vbCounter+20]=0.0f;            vbVertices[vbCounter+21]=vbRectangle->getLeftTopX();            vbVertices[vbCounter+22]=vbRectangle->getLeftTopY();            vbVertices[vbCounter+23]=0.0f;            vbCounter+=24;
So I want to create my own virtual button from a trackables, but I don't know how to create and render it on screen just by looking at the sample. so If there's any clear step by step tutorial of how to create virtual button that would really help a lot. 

AlessandroB

Wed, 12/19/2012 - 16:11

Hi, the vertex array "vbVertices" contains the coordinates of the end-points of the line segments that make up the buttons;

*sigh Is this site have no cookies? I have to login everytime I open this site* *ignore that*

anyway what I get from your answer is that the array contain x,y, and z in just a single dimensional array, right?

so it would looks like this ->