Opengl ES and texcoord
Posted
by viraptor
on Stack Overflow
See other posts from Stack Overflow
or by viraptor
Published on 2010-04-17T22:37:21Z
Indexed on
2010/04/17
22:43 UTC
Read the original article
Hit count: 151
opengl-es
|texture-mapping
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?
© Stack Overflow or respective owner