Ok, I’ve switched to structs and glDrawElements still doesnt work. Heres what I have:
<pre>
typedef struct __VECTOR
{
float x, y, z;
} VECTOR, VERTEX, NORMAL;
typedef struct __TEXCOORD
{
float u, v;
} TEXCOORD;
</pre>
I read everything in and if I use a for loop like so:
<pre>
for (ii = 0; ii < Object->Mesh[i].FaceCount; ii++)
{
glBegin(GL_TRIANGLES);
glTexCoord2f(Object->Mesh[i].TexCoord[Object->Mesh[i].Face[ii].i1].u, Object->Mesh[i].TexCoord[Object->Mesh[i].Face[ii].i1].v);
glNormal3f(Object->Mesh[i].Normal[Object->Mesh[i].Face[ii].i1].x, Object->Mesh[i].Normal[Object->Mesh[i].Face[ii].i1].y, Object->Mesh[i].Normal[Object->Mesh[i].Face[ii].i1].z);
glVertex3f(Object->Mesh[i].Vertex[Object->Mesh[i].Face[ii].i1].x, Object->Mesh[i].Vertex[Object->Mesh[i].Face[ii].i1].y, Object->Mesh[i].Vertex[Object->Mesh[i].Face[ii].i1].z);
glTexCoord2f(Object->Mesh[i].TexCoord[Object->Mesh[i].Face[ii].i2].u, Object->Mesh[i].TexCoord[Object->Mesh[i].Face[ii].i2].v);
glNormal3f(Object->Mesh[i].Normal[Object->Mesh[i].Face[ii].i2].x, Object->Mesh[i].Normal[Object->Mesh[i].Face[ii].i2].y, Object->Mesh[i].Normal[Object->Mesh[i].Face[ii].i2].z);
glVertex3f(Object->Mesh[i].Vertex[Object->Mesh[i].Face[ii].i2].x, Object->Mesh[i].Vertex[Object->Mesh[i].Face[ii].i2].y, Object->Mesh[i].Vertex[Object->Mesh[i].Face[ii].i2].z);
glTexCoord2f(Object->Mesh[i].TexCoord[Object->Mesh[i].Face[ii].i3].u, Object->Mesh[i].TexCoord[Object->Mesh[i].Face[ii].i3].v);
glNormal3f(Object->Mesh[i].Normal[Object->Mesh[i].Face[ii].i3].x, Object->Mesh[i].Normal[Object->Mesh[i].Face[ii].i3].y, Object->Mesh[i].Normal[Object->Mesh[i].Face[ii].i3].z);
glVertex3f(Object->Mesh[i].Vertex[Object->Mesh[i].Face[ii].i3].x, Object->Mesh[i].Vertex[Object->Mesh[i].Face[ii].i3].y, Object->Mesh[i].Vertex[Object->Mesh[i].Face[ii].i3].z);
glEnd();
}
</pre>
Each index in the Face struct is used for vertices, normals, and texcoords, but using
<pre>
glVertexPointer(3, GL_FLOAT, 0, Object->Mesh[i].Vertex);
glNormalPointer(GL_FLOAT, 0, Object->Mesh[i].Normal);
glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_SHORT, Object->Mesh[i].Face);
</pre>
gives me nothing, maybe I’m using these functions wrong, but I can’t see a problem.