Using Shapes in p5.js

Hi @bcabc,

I assume you are using p5js (JavaScript) and not Processing (Java) so there is no createShape() function in the reference.

One solution is to only use beginShape() and endShape():

beginShape(TRIANGLE_FAN);
strokeWeight(random(0.28));
vertex(100, -30);
vertex(90, 20);
vertex(3, -100)
endShape(CLOSE);
2 Likes