The following two methods produce the same results. I am working through some Game Institute courses and I am trying to figure out a few specific details about these different methods.

First Method 1 once rendered has the mesh rotating at a very slow rate where mesh 2 rotates the mesh much faster. I don’t really understand why anything within this code would effect a rotating speed. Can anyone offer advice why?

Second, I don’t understand why in method 2 there is a need to pass g_TriangleCount3 in the
function call. The second param in the glDrawElements function needs to be the number of triangles so why is there a need to multiply the triangles by 3. Multiplying by 3 returns the number of vertex’s right?

Render Mesh 1
for(TriangleNum=0; TriangleNum{
for (int VertexNum = 0; VertexNum < g_VertexCount; VertexNum++)

Render Mesh 2
glVertexPointer(3, GL_FLOAT, 0, g_pVertices);
glDrawElements(GL_TRIANGLES,g_TriangleCount*3,GL_UNSIGNED_SHORT, g_pFaceIndices);

The second method uses vertex arrays. These are much faster than the immediate mode used in the first piece of code. I assume that the rotation is tied to the framerate not governed by a timer. This means that the faster framerate caused by the use of vertex arrays leads to faster rotation

As for the second question, draw elements takes the number of vertices as an input, not the number of triangles. GL_TRIANGLES just tells the computer to treat the list of vertices as triangles

[This message has been edited by chowe6685 (edited 06-07-2003).]