vertex arrays
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 -
>>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
{
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement