"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

Replace the model used in ImageTargets

Hi Team :

1) I have a new file meh.h and I moved it to Jni Folder on proyect. This file was build from file object (meh.obj) using perl script

2) On Eclipse Proyect I have replaced this lines :

 

 glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid*) &mehVerts[0]);

 glVertexAttribPointer(normalHandle, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid*) &mehNormals[0]);

 glVertexAttribPointer(textureCoordHandle, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid*) &mehTexCoords[0]);

and these lines too :

 

glDrawArrays(GL_TRIANGLES, 0, mehNumVerts);

#include meh.h

3) Save All & Close Eclipse Proyect

4) Run ndk-build on DOS prompt and throw this message:

 

C:\Development\Android\vuforia-sdk-android-2-0-30\samples\ImageTargets-2-0-6>ndk-build"Compile++ arm  : ImageTargets <= ImageTargets.cppjni/ImageTargets.cpp: In function 'void Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargetsRenderer_renderFrame(JNIEnv*, jobject)':jni/ImageTargets.cpp:405:48: error: 'mehVertices' was not declared in this scope jni/ImageTargets.cpp:409:48: error: 'mehTexCoords' was not declared in this scopejni/ImageTargets.cpp:422:50: error: too few arguments to function 'void glDrawElements(GLenum, GLsizei, GLenum, const GLvoid*)'C:/android-ndk-r8d/platforms/android-8/arch-arm/usr/include/GLES2/gl2.h:515:37:note: declared heremake: *** [obj/local/armeabi/objs/ImageTargets/ImageTargets.o] Error 1 Team: Please your tips to behave this event,Thanks in advanced, German Medina Neria

 

AlessandroB

Mon, 01/07/2013 - 07:13

Hi, have you included the meh.h header in ImageTargets.cpp, i.e. have you added this line:

#include "meh.h"

(see line of code where you have  <  #include "Teapot.h"  >)

?

Hi :

Here are my results :

1.- mehVerts is working, I saw this come from (was declared into meh.h)

2.- Please your asistance, about mehTexCoords, I do not find ( gl_FragColor = texture2D(texSampler2D, texCoord);) to replace it

3.- On this command line was :

Hi, the fact that you get errors when you run the app in Eclipse is normal, because the ndk-build failed for the C++ part, so you need first to fix the C++ code.

What I see is that there something else wrong in your ImageTargets.cpp, but I need you to send me the whole file;

AlessandroB

Fri, 01/11/2013 - 16:57

Hi, this is the code that I just tested (compield and run), which works:

Note: make sure to revert to the original clean ImageTargets.cpp (which compiles and works), and then make these changes: