Advertisement

Question about glDrawElements and glTexCoordPointer

Started by June 13, 2001 06:03 PM
1 comment, last by BigMeph 23 years, 8 months ago
I load shared vertex, normal, and texture cordnate arrays along with the face index array from an obj file in to my mesh. struct mesh { GLfloat *vertices; GLfloat *noramls; GLfloat *texcoords; GLuint *indices; }mesh; I am trying to use glDrawElements like this: glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); glVertexPointer(3,GL_FLOAT,0,mesh.vertices); glNormalPointer(GL_FLOAT,0,mesh.normals); glTexCoordPointer(2,GL_FLOAT,0,mesh.texcoords); glDrawElements(GL_TRIANGLES,num_indices,GL_UNSIGNED_INT,mesh.indices); Do I have to reorganize my normals, vertecies and texcoordnates into huge arrays of redundant information just to use glDrawElements. Darin Perkins Game Design Student Full Sail, Orlando, FL E-Mail: BigMeph@netzero.net Home Page: home.earthlink.net/~bigmeph
Darin PerkinsGame Design StudentFull Sail, Orlando, FLE-Mail: [email=bigmeph@netzero.net]BigMeph@netzero.net[/email]Home Page: home.earthlink.net/~bigmeph
What is the face index array?
Perhaps do you have to make a function that calculates a index array for glDrawElements from the face index array.
Advertisement
I believe that face index array is actually the mesh indices. I check with my group member to make sure that is what he ment by it and i will get back to you.

Darin Perkins
Game Design Student
Full Sail, Orlando, FL
E-Mail: BigMeph@netzero.net
Home Page: home.earthlink.net/~bigmeph
Darin PerkinsGame Design StudentFull Sail, Orlando, FLE-Mail: [email=bigmeph@netzero.net]BigMeph@netzero.net[/email]Home Page: home.earthlink.net/~bigmeph

This topic is closed to new replies.

Advertisement