/* 6.914, Example 0.7 The custom shape tool is pretty simple to work with, but can produce interesting and cool-looking results. Basically, it looks like this: beginShape(); vertex(x1, y1); vertex(x2, y2); vertex(x3, y3); // as many vertices as you want here endShape(); Every vertex (except the last one) will have a line between itself and the one after it. The simplest parameter you can give to this tool is changing the last line to endShape(CLOSE); which will make a line between the last point and the first one. The following properties are basically independent for each shape: stroke (or noStroke), fill (or noFill), and CLOSE. (Of course, if you have noStroke, it doesn't matter whether you pass CLOSE as an argument.) */ void setup(){ size(400, 500); background(255); strokeWeight(3); } void draw(){ // stroke on by default, fill turned off noFill(); beginShape(); vertex(5, 100); vertex(50, 50); vertex(40, 70); vertex(80, 130); endShape(); // stroke on, fill off, CLOSE on beginShape(); vertex(5, 200); vertex(50, 150); vertex(40, 170); vertex(80, 230); endShape(CLOSE); // stroke on, fill on, CLOSE off fill(120, 0, 180); beginShape(); vertex(5, 300); vertex(50, 250); vertex(40, 270); vertex(80, 330); endShape(); // stroke off, fill on, CLOSE off (but irrelevant) noStroke(); beginShape(); vertex(5, 400); vertex(50, 350); vertex(40, 370); vertex(80, 430); endShape(); }