DrawPoly with concave areas

BlitzMax Forums/BlitzMax Programming/DrawPoly with concave areas

ima747(Posted 2008) [#1]
A brief search on drawpoly turned up

http://www.blitzmax.com/codearcs/codearcs.php?code=2259

which works quite well, with the exception of the noted crash it can cause with intersection edges. Is there a better method out there? Speed is not a huge issue for me, but stability and the ability of the method to handle different shapes is. Thoughts, suggestions, places to look?


Warpy(Posted 2008) [#2]
I think your best bet would be to first analyse your poly to find intersecting edges, then split it up accordingly.


ima747(Posted 2008) [#3]
Good call... any ideas how I might go about that? I've had a look through it but I don't quite get the whole process to begin with yet, let alone enough to expand on it.

btw, thanks for the code in the first place, it's saved me many an hour of headache in it's current state already. I've updated it for superstrict (because I'm anal like that) and gave it a more universal draw function with some sanity checks to stop the crashes, I can repost if there's any interest... I just have it as an include in my current project.


Warpy(Posted 2008) [#4]
Can you post the superstrict version as a comment to my version? I'm sure there are quite a few superstrict quibblers who'd like to use it.


ima747(Posted 2008) [#5]
Posted with some notes about what I changed. The superstrict conversion was was pretty much just declaration of variables. The DrawTriPoly() function I think makes it fairly practical.