When the cube is drawn only two faces on the cube are displayed correctly. The sides of the cube that are not drawn correctly are distorted and look as though they have been stretched from the correctly drawn sides edge to other. This is the code that is meant to draw the cube:
// 1 based arrayglBindTexture(GL_TEXTURE_2D, texture(1));glBegin(GL_TRIANGLES);//);GL_TRIANGLESfor(int iter = 0; iter < cubesy.index().size(); iter++) // 36 indices, 24 vertices{ int index = cubesy.index()[iter]; const cvertex& vertref = cubesy.vertex()[index]; const point3<short>& normref = cubesy.normal()[index]; glNormal3s(normref.x, normref.y, normref.z); glTexCoord2s(vertref.u, vertref.v); glVertex3f(vertref.x, vertref.y, vertref.z);}glEnd();
here is the data from the vtx file
// mesh01// 24 vertices// NOTE: first 3 are a vertex, second 3 are a normal, last 2 are a tex coord.Vertex-4.13221 -4.71958 -4.71959 0 0 -1 0 05.30695 -4.71958 -4.71959 0 0 -1 1 05.30695 4.71957 -4.71959 0 0 -1 1 1-4.13221 4.71957 -4.71959 0 0 -1 0 15.30695 -4.71958 4.71957 0 0 1 1 0-4.13221 -4.71958 4.71957 0 0 1 0 0-4.13221 4.71957 4.71957 0 0 1 0 15.30695 4.71957 4.71957 0 0 1 1 15.30695 -4.71958 -4.71959 1 0 0 1 05.30695 -4.71958 4.71957 1 0 0 1 05.30695 4.71957 4.71957 1 0 0 1 15.30695 4.71957 -4.71959 1 0 0 1 1-4.13221 4.71957 -4.71959 0 1 0 0 15.30695 4.71957 -4.71959 0 1 0 1 15.30695 4.71957 4.71957 0 1 0 1 1-4.13221 4.71957 4.71957 0 1 0 0 1-4.13221 -4.71958 -4.71959 -1 0 0 0 0-4.13221 4.71957 -4.71959 -1 0 0 0 1-4.13221 4.71957 4.71957 -1 0 0 0 1-4.13221 -4.71958 4.71957 -1 0 0 0 0-4.13221 -4.71958 -4.71959 0 -1 0 0 0-4.13221 -4.71958 4.71957 0 -1 0 0 05.30695 -4.71958 4.71957 0 -1 0 1 05.30695 -4.71958 -4.71959 0 -1 0 1 0// end of .Vertex// 12 faces.Index0 1 2 -10 2 3 -14 5 6 -14 6 7 -18 9 10 -18 10 11 -112 13 14 -112 14 15 -116 17 18 -116 18 19 -120 21 22 -120 22 23 -1// end if .Index
The source that I read about how to read from this file format said to draw as triangles, which is being done of course. However maybe I'm doing something wrong, even tho I did check that the data is being read in properly, and the drawing routine has the right stuff at the right time. Anyways for anyone who helps me, Thx : )