Jump to content
  • Advertisement
Sign in to follow this  
HopeDagger

Drawing concave polygons?

This topic is 4864 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

During the construction of my map editor, I found out (much to my dismay!) that GL_POLYGON will only draw convex polygons properly! Since my map is composed of polygons ('sectors', much like the Doom games), it's going to be very difficult to have to draw out maps using only convex polygons. Each 'sector' (or polygon) is composed of a list of vertices. Is there another method to draw the triangles in such a fashion that concave polygons appear properly? Many thanks in advance. If you need any further clarification on my dilemna, just ask. :)

Share this post


Link to post
Share on other sites
Advertisement
Look at Chapter 2 in the Red Book (link in forum faq) in the section on drawing polygons. It mentions that they must be convex and says to look at Appendix C to learn about the GLU tessellation functions.

Share this post


Link to post
Share on other sites
.....Or you could just use triangle strips on the same verts. If you draw them and the edges are next to each other, you can't tell. If they are complanar, you really can't tell. You could draw a quad using two triangles and texture a square on it and it will look like a square, not two triangles.

Share this post


Link to post
Share on other sites
Thanks both of you for the advice!

(EDIT: Removed supposed solution I had that didn't quite work :P)

[Edited by - HopeDagger on December 24, 2005 9:13:03 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!