PDA

View Full Version : Indexed array question



dabeav
03-26-2002, 06:23 PM
Ok here is a sample of the code i wan to use.

float vertexarray[] = {}
float normalarray[] = {}
float texarray[] = {}

int vertexindex[] = {}
int normalindex[] = {}
int texindex[] = {}

glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);

glVertexPointer(3, GL_FLOAT, 0,vertexarray);
glNormalPointer(GL_FLOAT, 0, normalarray);
glTexCoordPointer(2,GL_FLOAT,0,texarray);

glDrawElements(GL_TRIANGLES,0,GL_UNSIGNED_INT,vert exindex)

up till this point things work fine, but now i want to use my indexed arrays of texture cords and normals. I cant seem to do this with glDrawElements, can I? Can someone please let me know how to use indexing with texture cords, and normals. Its not so much the issue of saving calls to the memory, as much as it is ease of creating usable models from exported 3d modelers.
Oh by the way, i would like to keep my vertex data sepperated from the other data, since i will be doing rotations on individual pts in the array, and I do not want to clutter things up further. Any suggestions???