We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey!
I've run into an issue with custom 3d shapes using WEBGL. If I try to make shapes with more than three vertices, only the first three are read, so my polygon coordinate sets only produce triangles.
For instance, this:
beginShape();
vertex(-100,-100,0);
vertex(100,-100,0);
vertex(100,100,0);
vertex(-100,100,0);
endShape(CLOSE);
Only produces a triangle, although I've defined four points to form a square. Is there something I'm missing, or is there a workaround? Thanks!
Answers
beginShape takes an argument...
https://processing.org/reference/beginShape_.html
but the first example is very similar to yours, except 2d. try it anyway...
Thank you for the swift reply.
I tried passing arguments to beginShape, but I'm still getting triangles. I actually need to draw pentagons, which works fine in Java Processing (without arguments passed to beginShape), but in p5.js I can't get past three vertices.
https://github.com/processing/p5.js/issues/1209
Thanks! That answers a couple other things I was wondering about as well :)