Quad Strips and Texture Mapping

Started by
1 comment, last by V-man 15 years, 9 months ago
Hi everyone, I have what should be a quick question. I am currently programming a Rubik's Cube game , and my DrawCub() function draws each quad separately. I've had a few complaints about how slowly the game runs when I send it to other people for testing, and I was thinking of speeding it up by using GL_QUAD_STRIPS instead of drawing a bunch of separate quads for each face, since this will reduce the number of calls to GlVertex3f I make. My problem is, I am texture mapping the quads. Since I have to specify texture coordinates for each vertex, can I use quad strips or does it have to be the way I've already done? Thanks!
Advertisement
Yes, you can use quadstrips. However, I question if you're drawing enough triangles for this to make a difference. If anything, I suspect you'll end up losing performance by using quadstrips due to more glBegin and glEnd calls as you'll need to switch back to triangles or quads in order to completely render a cube.

I suspect your problem lies elsewhere. If you post your code perhaps I could find out if that's the case.
You are probably rendering something like 50 polygons which isn't the cause of the low performance.
Ask your users to update their video drivers and ask them what hw they are running.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement