How can we show a layout instead of tea pot model in vuforia sdk ImageTarget after image recognition

一世执手 提交于 2019-12-12 19:03:59

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!