Archived

This topic is now archived and is closed to further replies.

outRider

vertex arrays

Recommended Posts

I''m having a little problem understanding them. I have the following setup... type face { short normalindex[3]; short vertexindex[3]; } type vertex { float vertex[3]; } type texcoord { float texcoord[2]; } type normal { float normal[3]; } type mesh { type *face; type *vertex; type *texcoord; type *normal; } glVertexPointer(3, GL_FLOAT, 0, mesh.vertex); glNormalPointer(GL_FLOAT, 0, mesh.normal); Now, if I use glDrawElements and pass mesh.vertexindex it doesn''t work, even if i specify a 6 byte offset (3 shorts for the normal index); Second, Im not even sure how I could use the normals and the texture coords with glDrawElements... I know I can use glInterleavedArray but that uses the actual vertices/normals/etc and not the indices.... Can anyone explain a solution to me? ------------ - outRider -

Share this post


Link to post
Share on other sites
>>type face
{
short normalindex[3];
short vertexindex[3];
}
<<

u cant have 2 indexs, vertices/texcoords/normals/colours all have to share the same index.

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites