Jump to content
  • Advertisement


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


Triangle strips and a simple cube

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

If you intended to correct an error in the post then please contact us.

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 this post

Link to post
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)


Share this post

Link to post
Share on other sites
the trick is to "unfold" the cube.

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.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!