Sign in to follow this  
tastethescabs

OpenGL Fill the inside of an arbitrary polygon

Recommended Posts

Hi, I've been googling all day to try to find a solution to this problem that i thought was trivial..but no success. Here is what i need to do: The user draws a path on a 2d plane and then when it's closed, i want to fill the interior of the contour with a color. The first part is already working (drawing the path) but i can't fill the inside, i think i need to triangulate the inside of the polygon but i'm not sure which way would be the simplest. The only way i found so far would be to use the GluTesselator from OpenGL but since i'm working in vb.net and managed directx, there would be quite a lot of conversion involved to be able to use the samples on the net. I'm really hoping there is another simpler solution and that somebody here can help me! Thank you

Share this post


Link to post
Share on other sites
thanks but i need to use direct3d, because once this polygon will be created i need to be able to easily rotate, zoom, pan, and eventually move in 3D (the polygon is in fact the floor of a room and the contour is walls, so in the future the walls will have a height)

Share this post


Link to post
Share on other sites
thanks, i'll be using the Polygon Triangulation in C# that i found here:

http://www.codeproject.com/csharp/cspolygontriangulation.asp

i tried it and it works ok... although it doesnt work for polygons with holes, it will do for now and maybe i'll try to export the gluTesselator samples in C to DLL so that i can use them with vb

thank you

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this