Sorry for the duplicaiton, but I've been googlin' for hours now without any result.
I have this (optimized) data of a simple cube exported from a converter:
// 8 Verticies
// 4 Texture Coordinates
// 6 Normals
// 12 Triangles
static GLshort cubeFace_indicies[12][9] = {
// Box001
{2,0,3 ,0,0,0 ,0,1,2 }, {1,3,0 ,0,0,0 ,3,2,1 }, {5,4,7 ,1,1,1 ,1,3,0 },
{6,7,4 ,1,1,1 ,2,0,3 }, {1,0,5 ,2,2,2 ,1,3,0 }, {4,5,0 ,2,2,2 ,2,0,3 },
{3,1,7 ,3,3,3 ,1,3,0 }, {5,7,1 ,3,3,3 ,2,0,3 }, {2,3,6 ,4,4,4 ,1,3,0 },
{7,6,3 ,4,4,4 ,2,0,3 }, {0,2,4 ,5,5,5 ,1,3,0 }, {6,4,2 ,5,5,5 ,2,0,3 }
};
static GLfloat cubeVertices [8][3] = {
{-100.0f,-100.0f,-100.0f},{100.0f,-100.0f,-100.0f},{-100.0f,100.0f,-100.0f},
{100.0f,100.0f,-100.0f},{-100.0f,-100.0f,100.0f},{100.0f,-100.0f,100.0f},
{-100.0f,100.0f,100.0f},{100.0f,100.0f,100.0f}
};
static GLfloat cubeNormals [6][3] = {
{0.0f,0.0f,1.0f},{0.0f,0.0f,-1.0f},{0.0f,1.0f,0.0f},
{-1.0f,0.0f,0.0f},{0.0f,-1.0f,0.0f},{1.0f,0.0f,0.0f}
};
static GLfloat cubeTextures [4][2] = {
{1.0f,2.0f},{1.0f,1.0f},{0.0f,2.0f},
{0.0f,1.0f}
};
I have a texture set up, and I want to see something on the screen. My recent drawing code below:
glTexCoordPointer(2, GL_FLOAT, 0, cubeTextures);
glVertexPointer(3, GL_FLOAT, 0, cubeVertices);
glNormalPointer(GL_FLOAT, 0, cubeNormals);
glBindTexture(GL_TEXTURE_2D, textures[0]);
glDrawElements(GL_TRIANGLES , 12, GL_SHORT, cubeFace_indicies);