Log in or register to post comments

Problem build banana.h

November 17, 2013 - 9:08am #1

Hi,

 

I try to replace the teapot of the ImageTarget sample.

I try with banana.h which I obtain with the objtoopengl script. I add it in my project and modifi the ImageTarget.cpp but when i build it with ndk- build i have these errors : 

"bananaVerts is not declared" bananaNormals" is not declaredetc

I try to modify banana.h and put these lines out of commentary (sorry for my very bad english)

glVertexPointer(3, GL_FLOAT, 0, bananaVerts);
glNormalPointer(GL_FLOAT, 0, bananaNormals);
glTexCoordPointer(2, GL_FLOAT, 0, bananaTexCoords);
 
but then i have these errors :
 
 
error: expected constructor, destructor or type of conversion" for the 3 lines.
 
Can someone help me to fix this problems or upload me a banana.h that is working fine.
 
Thx 

Problem build banana.h

November 19, 2013 - 7:08am #6

Glad to hear this.

Problem build banana.h

November 19, 2013 - 6:35am #5

I finally succed to change my teapot with the banana !

 

To do this I put :

glVertexPointer(3, GL_FLOAT, 0, bananaVerts);
glNormalPointer(GL_FLOAT, 0, bananaNormals);
glTexCoordPointer(2, GL_FLOAT, 0, bananaTexCoords);
 
in commentary in banana.h
 
and then I modify the imagetargets.cpp by following this link :
 
 
Thanks for your help !

Problem build banana.h

November 19, 2013 - 6:35am #4

I finally succed to change my teapot with the banana !

 

To do this I put :

glVertexPointer(3, GL_FLOAT, 0, bananaVerts);
glNormalPointer(GL_FLOAT, 0, bananaNormals);
glTexCoordPointer(2, GL_FLOAT, 0, bananaTexCoords);
 
in commentary in banana.h
 
and then I modify the imagetargets.cpp by following this link :
 
 
Thanks for your help !

Problem build banana.h

November 19, 2013 - 5:20am #3

hey,

 

Thank you for your answer,

Yes I have include banana.h in Imagetargets.cpp

 

I read the link that you give but my problem is that i don't know how to declare the vertices, the normals and the textcoords of my banana.h

 

here is my banana.h

/*
created with obj2opengl.pl

source file    : ./banana.obj
vertices       : 4032
faces          : 8056
normals        : 4032
texture coords : 4420
*/

// include generated arrays
#import "./banana.h"

// set input data to arrays
glVertexPointer(3, GL_FLOAT, 0, bananaVerts);
glNormalPointer(GL_FLOAT, 0, bananaNormals);
glTexCoordPointer(2, GL_FLOAT, 0, bananaTexCoords);



// draw data

//glDrawElements(GL_TRIANGLES, NUM_TEAPOT_OBJECT_INDEX, GL_UNSIGNED_SHORT, (const GLvoid*) &teapotIndices[0])

//glDrawArrays(GL_TRIANGLES, 0, NUM_TEAPOT_OBJECT_INDEX  );
unsigned int bananaNumVerts = 24168;

float bananaVerts [] = {

//A lot of number

};
 

But I obtain an error with :

glVertexPointer(3, GL_FLOAT, 0, bananaVerts);
glNormalPointer(GL_FLOAT, 0, bananaNormals);
glTexCoordPointer(2, GL_FLOAT, 0, bananaTexCoords);

 

That throw me an error when I make my ndk-build :

error : expected constructor, destructor, or type of conversion before '(' token 

 

Problem build banana.h

November 18, 2013 - 1:28pm #2

Have you added this line:

#include ''banana.h"

?

Also, have you checked the steps explained here in detail?

https://developer.vuforia.com/forum/faq/android-how-do-i-replace-teapot

 

Log in or register to post comments