Jump to content
  • Advertisement
Sign in to follow this  
TheFallenOne

DX9 Ngon Handling (Mesh Creation)

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

Hey guys,

I've recently written my own custom Wavefront OBJ model importer (in C++) that creates a DX9 mesh based on the OBJ/MTL information supplied.

The only problem I'm having is with faces with more than 4 vertices (Ngons). I can handle quads just fine, but more than that I'm not 100% sure how I should handle it when creating a new mesh, and information seems to be pretty scarce on the web.

Does anyone have any pointers on where to start?

Share this post


Link to post
Share on other sites
Advertisement
You are basically looking for triangulation algorithms, and there are lots of them floating around. If the polygons are convex, then it can be fairly easy to generate triangles from them. You create a vertex with the average of all the other vertices positions. Then every two consecutive vertices plus the new center vertex form a triangle.

If the ngon is not convex, then it will be slightly more complicated - but still very much within grasp. What kind of geometry are you working with?

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!