Lets shape up! Pages: 69-77
Lets draw random shapes Commands introduced vertex(x,y); beginShape() endShape() curveVertex() BezierVertex()… lets not worry about this now
Shape with vertex(x,y) nofill(); beginShape(); vertex(30,20); vertex(85,20); vertex(85,75); vertex(30,75); endShape();
Lets close the Shape //nofill(); beginShape(); vertex(30,20); vertex(85,20); vertex(85,75); vertex(30,75); endShape(CLOSE);
POINTS or LINES? //nofill(); beginShape(POINTS);// lets change it to LINES vertex(30,20); vertex(85,20); vertex(85,75); vertex(30,75); endShape(CLOSE);
TRIANGLES or TRIANGLE_STRIP //nofill(); beginShape(TRIANGLES); vertex(75,30); vertex(10,20); vertex(75,50); vertex(20,60); vertex(90,70); Vertex(35,85); endShape();
Curves smooth(); noFill(); beginShape(); curveVertex(20,80); curveVertex(20,40); curveVertex(30,30); curveVertex(40,80); curveVertex(80,80); endShape();
Putting it all together smooth(); noFill(); beginShape(); vertex(15,40); bezierVertex(5,0,80,0,50,55); vertex(30,45); vertext(25,75); bezierVertex(50,70,75,90,80,70); endShape();
bezierCurve: 1 noFill(); beginShape(); vertex(32,20); bezierVertex(80,5,80,75,30,75); endShape();
B.Curve2 beginShape(); vertex(30, 20); bezierVertex(80, 0, 80, 75, 30, 75); bezierVertex(50, 80, 60, 25, 30, 20); endShape();