"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

Different models for different targets

I am trying to add different models to different targets respectively,

i  made some implementation,  like below

 

int textureIndex;

const float* thisVertices;const float* thisTexCoords;const float* thisNormals;const unsigned short* thisIndices; if (!strcmp(trackable.getName(), "stones")){   textureIndex = 0;   thisVertices = teapotVertices;   thisTexCoords = teapotTexCoords;   thisNormals = teapotNormals;   thisIndices = teapotIndices;}else if (!strcmp(trackable.getName(), "chips")){   textureIndex = 1;   thisVertices = teapotVerticesA;   thisTexCoords = teapotTexCoordsA;   thisNormals = teapotNormalsA;   thisIndices = teapotIndicesA;}   and i include two different models, but after ndk-build  it show such kind of error   "Compile++ arm  : ImageTargets <= ImageTargets.cppjni/ImageTargets.cpp: In function 'void Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargetsRenderer_renderFrame(JNIEnv*, jobject)':jni/ImageTargets.cpp:544:22: error: 'teapotVertices' was not declared in this scopejni/ImageTargets.cpp:545:23: error: 'teapotTexCoords' was not declared in this scopejni/ImageTargets.cpp:546:21: error: 'teapotNormals' was not declared in this scopejni/ImageTargets.cpp:547:21: error: 'teapotIndices' was not declared in this scopemake: *** [obj/local/armeabi/objs/ImageTargets/ImageTargets.o] Error 1

 

But this variables are already declared in h file of model?

Or I must declare them somewhere else? 

 

AlessandroB

Tue, 06/25/2013 - 10:03

Hi, have you included "teapot.h" ?

This is just about C++, you simply need to check if all the variables that you use have been defined either globally, or locally in the scope of the function that you are using, or in a header file that you include....etc.....