P5JS – LA 1 – 1.4
This is the last lesson before the mimi project and we had to play around with the shapes. I learned the arc shape and how to make a shape per point using BeginShape(). This is what I made.
function setup() {
createCanvas(400, 400);
background(225);
//triangle//
triangle(20, 20, 90, 160, 160, 20);
//quad//
quad(220, 20, 380, 20, 320, 160, 280, 160);
//star//
beginShape();
vertex(90, 240);
vertex(105, 280);
vertex(160, 280);
vertex(115, 310);
vertex(140, 360);
vertex(90, 330);
vertex(50, 360);
vertex(65, 310);
vertex(20, 280);
vertex(75, 280);
endShape(CLOSE);
//arc//
arc(340, 270, 180, 180, HALF_PI, PI);
}
After making these shapes I practiced around some more with the arcs and this is what I made:
function setup() {
createCanvas(600, 200);
}
function draw() {
background(225);
arc(550, 100, 100, 100, 0, TWO_PI);
arc(450, 100, 100, 100, 0, PI+HALF_PI+QUARTER_PI);
arc(350, 100, 100, 100, 0, PI+HALF_PI);
arc(250, 100, 100, 100, 0, PI+QUARTER_PI);
arc(150, 100, 100, 100, 0, PI);
arc(50, 100, 100, 100, 0, HALF_PI+QUARTER_PI);
}