planar non-convex polygon from list of points?
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. :-(
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.
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.
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.
Look up "tessellating non-convex polygons". This well-known technique is used to break up complex shapes into triangle soups or other primitive setups.
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]
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]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement