Triangle strips and a simple cube
I''m just a beginner in OpenGL and would like to know if it''s possible to make a cobe out of triangle strips? When I tried to it always vent a bit wrong and some parts of the cube weren''t drawn. If it is possible I would appreciate if someone could make a simple example like this:
glBegin(TRIANGLE_STRIPS);
glVertex3f(1.0f,1.0f,1.0f);
...
glEnd();
Also I would like to know, if (and how much) it''s faster than to do the same thing (a cube) with simple triangles rather than triangle strips?
it is possible to make a cube from one strip (a bit contrived but)
the thing is though very likely u wont see any speed increase doing it this way, in fact if your drawing 1000''s of cubes, using tri sprips might be even slower than using tris. (with tris u can combine all the cubes into one call)
(unless u are fillrate etc bound then it doesnt really matter what method u use VAR,DL,CVA,immediate)
http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
the thing is though very likely u wont see any speed increase doing it this way, in fact if your drawing 1000''s of cubes, using tri sprips might be even slower than using tris. (with tris u can combine all the cubes into one call)
(unless u are fillrate etc bound then it doesnt really matter what method u use VAR,DL,CVA,immediate)
http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
the trick is to "unfold" the cube.
Here''s your cube.
Unfold the cube as such:
And draw the tris in that order.
Don''t listen to me. I''ve had too much coffee.
Here''s your cube.
_____ / 2 /|/____/ || |3|| 1 | /|____|/side 4 is opposite side 1.side 5 is opposite side 2.side 6 is opposite side 3.
Unfold the cube as such:
___________| | || 1 | 2 ||_____|_____|_____ | | | | 3 | 4 | |_____|_____|_____ | | | | 5 | 6 | |_____|_____|
And draw the tris in that order.
Don''t listen to me. I''ve had too much coffee.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement