Question about glDrawElements and glTexCoordPointer
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
June 13, 2001 07:21 PM
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.
Perhaps do you have to make a function that calculates a index array for glDrawElements from the face index array.
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 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
Popular Topics
Advertisement
Recommended Tutorials
Advertisement