Hi to All,
I have to change teapot object to banana object .
i do some changes in virtualbuttons app .
i have banana.h file i put that in jni folder and bananayellow.png, bananawhite.png files in assets folder.
and i change somecode in VirtualButtons.cpp file like below as per some posts
// Render 3D model glUseProgram(shaderProgramID); glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid*) &bananaVerts[0]); glVertexAttribPointer(normalHandle, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid*) &bananaNormals[0]); glVertexAttribPointer(textureCoordHandle, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid*) &bananaTexCoords[0]); glEnableVertexAttribArray(vertexHandle); glEnableVertexAttribArray(normalHandle); glEnableVertexAttribArray(textureCoordHandle); glBindTexture(GL_TEXTURE_2D, thisTexture->mTextureID); glUniformMatrix4fv(mvpMatrixHandle, 1, GL_FALSE, (GLfloat*)&modelViewProjection.data[0] ); glDrawArrays(GL_TRIANGLES, 0, bananaNumVerts);
and also i replaced in src/VirtualButtons.java file like below
private void loadTextures() { mTextures.add(Texture.loadTextureFromApk("TextureBananaYellow.png", getAssets())); mTextures.add(Texture.loadTextureFromApk("TextureBananaRed.png", getAssets())); /*mTextures.add(Texture.loadTextureFromApk("TextureTeapotBrass.png", getAssets())); mTextures.add(Texture.loadTextureFromApk("TextureTeapotRed.png", getAssets())); mTextures.add(Texture.loadTextureFromApk("TextureTeapotBlue.png", getAssets())); mTextures.add(Texture.loadTextureFromApk("TextureTeapotYellow.png", getAssets())); mTextures.add(Texture.loadTextureFromApk("TextureTeapotGreen.png", getAssets()));*/ }
i rebuild it and run it but there was no errors but that banana image was not displaying when showing the wood image through camera.
Was I done anything wrong. Can Anyone please help me.
Thanks in Advance.
How to replace teapot to banana in virtualbutons?
Hi, the code looks fine,
you might simply need to adjust the kObjectScale (increase it to e.g. 100.0f, current value is 3.0f)
This may solve your issue.
How to replace teapot to banana in virtualbutons?
Hi AlessandroB,
Thanks a lot its working now.
How to replace teapot to banana in virtualbutons?
Great, You're welcome.
How to replace teapot to banana in virtualbutons?
Hi AlessandroB,
can we change the colors when we clicking on the mobile toogle buttons.
when i clicking toogle buttons in mobile, the colors are not changing. How can we change colors with clicking toogle buttons also.
Thanks in advance.
How to replace teapot to banana in virtualbutons?
Hi, can you calrify a bit?
have you tried the original VirtualButtons sample (without any changes) ?
does it work?
what are the specific things that you want to change and which do not seem to work ?
How to replace teapot to banana in virtualbutons?
Hi AlessandroB,
Without any changes also the toggle buttons are not working.
When we clicking on toggle buttons on mobile screen it doesn't changing the color.
how can we change colors by clicking the toggle buttons on mobile screen.
Thanks in advance.
How to replace teapot to banana in virtualbutons?
Ok, I see; you're trying to change button color via touch of the screen;
that's not how Virtual Buttons work, you need to really touch the buttons on the real printed target (on paper)...
How to replace teapot to banana in virtualbutons?
Hi AlessandroB,
Is there no way to change colors touching on screen.
Thanks in Advance.
How to replace teapot to banana in virtualbutons?
Hi, yes,
you can also change the color (or do any other action you like) when touching the button via the screen;
this is however not supported out-of-the-box by Vuforia; you will need to put some code together to achieev that;
How to replace teapot to banana in virtualbutons?
hi AlessandroB
i follow your suggestion to take a look for videoplayback.cpp
i paste the isTapOnScreenTarget for my code