问题
How can we show a simple text i.e. "Hello" in a layout, if the the image is recognized in qualcomm vuforia sdk. i am using qualcomm vuforia sdk sample of ImageTarget, now it is showing a teapot after image is recognized. I am new in augmented reality. please help me.
回答1:
in JNI folder go to imagetarget.cpp file comment the Following things
#include "Teapot.h"
this is the file that is loading a 3d Texture after that
// Draw object:
glBindTexture(GL_TEXTURE_2D, thisTexture->mTextureID);
glTexCoordPointer(2, GL_FLOAT, 0, (const GLvoid*) &teapotTexCoords[0]);
glVertexPointer(3, GL_FLOAT, 0, (const GLvoid*) &teapotVertices[0]);
glNormalPointer(GL_FLOAT, 0, (const GLvoid*) &teapotNormals[0]);
glDrawElements(GL_TRIANGLES, NUM_TEAPOT_OBJECT_INDEX, GL_UNSIGNED_SHORT,
(const GLvoid*) &teapotIndices[0]);
for Vertices Comment the following lines
glUseProgram(shaderProgramID);
glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0,
(const GLvoid*) &teapotVertices[0]);
glVertexAttribPointer(normalHandle, 3, GL_FLOAT, GL_FALSE, 0,
(const GLvoid*) &teapotNormals[0]);
glVertexAttribPointer(textureCoordHandle, 2, GL_FLOAT, GL_FALSE, 0,
(const GLvoid*) &teapotTexCoords[0]);
and this one
glDrawElements(GL_TRIANGLES, NUM_TEAPOT_OBJECT_INDEX, GL_UNSIGNED_SHORT,
(const GLvoid*) &teapotIndices[0]);
that is to show the texture on the marker compile code using
ndk-build in Cmd
and run the Teapot will not be shown and in on create show your own Text button the normal way of android
来源:https://stackoverflow.com/questions/13988035/how-can-we-show-a-layout-instead-of-tea-pot-model-in-vuforia-sdk-imagetarget-aft