Jump to content
  • Advertisement
Sign in to follow this  
tastethescabs

OpenGL Fill the inside of an arbitrary polygon

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

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
Advertisement
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
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!