XNA Creators Club Online
Page 1 of 1 (4 items)
Sort Posts: Previous Next

Polygon Union/Polygon Clipping

Last post 08-12-2008 10:06 PM by The ZMan. 3 replies.
  • 08-12-2008 9:25 PM

    Polygon Union/Polygon Clipping

    Hello!

    I'm stuck looking for a way to combine two convex polygons together. These polygons are not self-intersecting and don't have holes.

    I have looked for suitable libraries on the internet but they are all implemented in c++ which makes running on Xbox impossible. I'm quite surprised about the lack of resources available on the subject, or maybe i'm just not trying hard enough.

    Any Help would be appreciated! :D

  • 08-12-2008 9:38 PM In reply to

    Re: Polygon Union/Polygon Clipping

    I dont know of any such libraries in C#. Everything you can find is in C++ because traditionally that's where all the graphics work is done. Its usually trivial if not time consuming to convert them to c#. Half the stuff usually compiles directly. If it has a lot of pointer stuff then don't forget that is valid in C# even on the 360 so you can usually just stick that in an unsafe block and let it run.
    The ZBuffer News and information for XNA

    Please read the forum FAQs - Bug/Feature reporting
  • 08-12-2008 9:45 PM In reply to

    Re: Polygon Union/Polygon Clipping

    Well maybe someone needs to port one of the libraries to c# then! I've found a library called the General Polygon Clipper Library which has a c# wrapper.

    Am I correct in assuming that using the c# wrapper won't work on xbox?

    Looks like i've got some converting to do...

  • 08-12-2008 10:06 PM In reply to

    Re: Polygon Union/Polygon Clipping

    Correct - code needs to be 100% managed and use only the assemblies availalbe in the Copact Framework to run on the 360

    Often people think unsafe code is not considered managed but its quite acceptable on the 360 and really does help convert some of these older C++ libraries.

    The ZBuffer News and information for XNA

    Please read the forum FAQs - Bug/Feature reporting
Page 1 of 1 (4 items) Previous Next