(p5.js) Custom shapes with more than three vertices

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

Sign In or Register to comment.