Problems with DrawPoly

Monkey Forums/Monkey Programming/Problems with DrawPoly

SLotman(Posted 2014) [#1]
So, I was trying to code some 2D visibility tests in Monkey - The red dots are the intersections from rays cast from the mouse position (the large red circle) to where it collides in the polygon. The green lines are the resulting polygon line-segments. The yellow thing is the polygon drawn by DrawPoly.

All looks fine in HTML5, like the picture below:


But on GLFW, the poly is messed up:


I saw then that DrawPoly needs a convex polygon, which explains the errors. Then I saw a post telling about a "triangulate function" which should fix this up...
... indeed it does, but not only it is very slow, but also sometimes it just locks up my program!

Can anyone help me out? Is there a function somewhere to draw polygons just like in html5?


Oddball(Posted 2014) [#2]
You can use the standard polygon function if you start in the center point of the polygon.


Difference(Posted 2014) [#3]
Look at this:

Drawtriangles: http://monkeycoder.co.nz/Community/posts.php?topic=8246

Tesselate : http://www.monkey-x.com/Community/posts.php?topic=8035