# planar non-convex polygon from list of points?

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

## Recommended Posts

Hello! I'm very new to DirectX programming. Probably the answer to my question isn't all that complicated, by I googled for abount an hour and still did't find a proper solution. So I hope that anybody can help me here. I'm writing a little presentation-tool for displaying maps with DirectX. The given data is a set of polygons. Each polygon is a list of 2D-points. The last points equals the fist one. So all polygons are flat/planar, but they are not necessarily convex. They don't have holes. Currently my apllication uses a linestrip to display these polygons, which works fine. But now I need to fill these polygons with colors. TriangleFans and TriangleStrips can'' render non-convex shapes. Do I'm a little stuck here. :-(

##### Share on other sites
Triangle strips and fans don't have any limitation about the convexity of the resulting shape. By supplying a central vertex, a triangle strip should be able to render your polygon.

##### Share on other sites
Ok, the last sentence of my first posting is nonsense. :-)
TiangleFan and Strip can indeed render nonconvex shapes.

But your posting doesn't solve my problem.

I have quite complex shapes.
Perhaps something like this:
http://www.sciencebuddies.org/mentoring/project_ideas/Math_img011.jpg

And I only have the vertices in counter-clockwise order.
Simply using a fan or strip certainly doen't produce the expected result.

##### Share on other sites
Look up "tessellating non-convex polygons". This well-known technique is used to break up complex shapes into triangle soups or other primitive setups.

##### Share on other sites
ok, but where shall I look this up.

I tried google and the search function of this forum and I really didn't find a simple solution for my simple problem :-)

edit:
found this:
http://msdn2.microsoft.com/en-us/library/ms537814.aspx

BUT it's OpenGL. I can't beleave that even on Microsofts website I only find a solution for OpenGL and not Direct3D :-((

[Edited by - gammaomega on April 10, 2007 5:59:45 AM]

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 11
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633722
• Total Posts
3013538
×