GL_TRIANGLE_STRIP vs. GL_TRIANGLES

Hi people!
I am going crazy! the following has no sense, but I can confirm is true: I have this code:

for(i=0;i<this->lStripsD.num;i++) {
glBegin(GL_TRIANGLE_STRIP);
for (it = this->lStripsD[i].begin(); it != this->lStripsD[i].end(); ++it) {
v=*it;
x=this->lVerts[v].x; y=this->lVerts[v].y; z=this->lVerts[v].z;
glVertex3f(x,y,z);
}
glEnd();
}

and another version with the same mesh but using GL_TRIANGLE draws it in less time…

with GL_TRIANGLE_STRIP I send 7190 vertex with all the stripes, and with GL_TRIANGLES I send 17412 vertexs, how is it posible?

Thansk for your help!!!

You’re CPU limited because you’re doing everything in immediate mode using glVertex(). Your triangle code is probably less CPU intensive than your triangle strip code, which explains the worse performance of the latter.

I suggest you use display lists and/or vertex arrays. (and if you want to go even further, use vertex buffer objects).

with display lists the performance is worse, it is not applicable to my problem because the mesh changes dynamically…

Anyway thanks a lot!
F.

Originally posted by jframosr:
it is not applicable to my problem because the mesh changes dynamically…

VBOs are THE answer then.
But you should try simple vertex arrays first if you’re not used to them yet, you should already get an impressive boost in performance with these anyway.