drawim
drawim copied to clipboard
Error to fill non convex polygon in opengl
Instead it fills the convex hull of the polygon
Example:
import drawim
proc draw() =
background(220)
fill(255,0,0)
beginFilledShape()
vertex(100, 100)
vertex(300, 300)
vertex(500, 100)
vertex(300, 200)
endFilledShape()
run(600, 400, draw)
In js it works
https://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml
This might work, and the code is clean. Saving here to study it later