Log in or register to post comments

Different models for different targets

June 24, 2013 - 4:14am #1

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.cpp
jni/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 scope
jni/ImageTargets.cpp:545:23: error: 'teapotTexCoords' was not declared in this scope
jni/ImageTargets.cpp:546:21: error: 'teapotNormals' was not declared in this scope
jni/ImageTargets.cpp:547:21: error: 'teapotIndices' was not declared in this scope
make: *** [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? 

 

Different models for different targets

June 25, 2013 - 3:03am #2

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.....

 

Log in or register to post comments