Jump to content
  • Advertisement


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


triangle or polygon?

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

How do you define a "face" in your scene or terrain? face = triangle (3 indices/face) or polygon (>=3 indices/face)? Which one is better (faster fit to render pipeline, faster collision detection, etc.)?

Share this post

Link to post
Share on other sites
Yup same here, always face=triangle.

Its the most hardware friendly (i.e. most hardware only supports triangles). Almost all systems which allow non triangular polygons convert them to triangles at some stage.

The constraints etc make lots of the maths simpler.

The biggest VERY useful constraint I can think of is that a 3D triangle will never be concave or "twisted", it always lies in a plane. Concave stuff causes lots of "issues" for many things. The core of most collision is often a "something to plane" check. Backface culling based on winding order relies on a plane or "outness" to work properly etc...

Simon O''Connor
Creative Asylum Ltd

Share this post

Link to post
Share on other sites
Yes, that is what I think too.

I asked this question because I just studied the Quake3 .bsp file format from gametutorials.com. The file defined a face as a polygon, and the tutorial sample code call glDrawArrays using triangle fans for every single non-culled face in render time.

So, I wonder isn''t it better to store a face as a triangle, so that it''s possible to group many faces and render by one call - using triangle lists.

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.

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!