views:

114

answers:

1

Hi,

I've got some code which I would like to translate into Opengl ES. I'm not experienced with it however, so here it goes. The original code does a loop like this:

glBegin(GL_TRIANGLES);
for(i=0; i<num_triangles; i++) {
   glNormal(...);

   glTexCoord2f(...);
   glVerted3fv(...);

   glTexCoord2f(...);
   glVerted3fv(...);

   glTexCoord2f(...);
   glVerted3fv(...);
}
glEnd();

So that's ok - I can change the vertex handling for each triangle in the loop, into the standard:

glEnableClientState (GL_VERTEX_ARRAY);
glVertexPointer (3, GL_SOMETHING, 0, verts);
glDrawArrays (GL_TRIANGLES, 0, 3);

But how do I add the texcoord setting into this example?

+1  A: 

Ok - the answer was obvious after all. glTexCoordPointer and glNormalPointer can be used to fill the rest of the data.

viraptor