#### Archived

This topic is now archived and is closed to further replies.

# Triangle strips and a simple cube

This topic is 5499 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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?

##### Share on other sites
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

##### Share on other sites
the trick is to "unfold" the 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.

• ### Forum Statistics

• Total Topics
628647
• Total Posts
2984034

• 10
• 9
• 9
• 10
• 21