Gl.mesh: "Line_loop" behaves different from "polygon"?
Hello,
Ami missing something here? Shouldn't switching to "polygon" show the same shape as "line_loop" but filled?
(Bang the jit.noise again after loading the patch)
TIL OpenGL polygon draw mode can only draw convex polygons, as stated in the gl3 doc.
In your case, you'll mostly get concave polygons, ie. which have at least one angle toward the inside of the polygon, if that makes sense. Hence the "wrong", but expected, drawing you get.
Here is an example about how to use @draw_mode triangles
instead of polygon
, and use an index matrix into the jit.gl.mesh rightmost inlet to tell it which vertices to use to draw triangles.
I limited the inital jit.noise to a dim of 3, which means you have a matrix of dim 6 1 for your line_loop, and an index matrix of dim 12 1, because we need 4 triangles to draw our polygon.
Now you need to adapt the logic for X number of points in your initial line.
Ah thanks, i was not aware of this! Was losing my head over it...