xxxxxxxxxx
58
// create an animated shape drawing program: -- DONE
// using a custom function w/ parameters –> -- DONE
// in that function, use
//translate(), -- DONE
//rotate(), -- DONE
//angleMode(DEGREES), -- DONE
//push(), -- DONE
//pop() -- DONE
//(in addition to other techniques we’ve learned,
//such as custom variables and conditional logic with if/else)
//to animate a custom shape so that your program makes a drawing over time.
// post an embed and link to your blog.
// bonus goal: use more than one shape using more than one function
// bonus goal: use mouseX/mouseY and map() to control some aspect of the shapes!
// optional: capture and post to your Instagram
let ro = 0;
function setup() {
createCanvas(300, 300);
colorMode(HSB);
angleMode(DEGREES);
background(11,83,91);
}
function draw() {
pots(width/2, height/2);
ro = ro + 2;
}
function pots(x,y,w,h){
fill(216,75,29);
stroke(250);
push();
translate(x,y);
rotate(ro);
beginShape();
vertex(0,0);
vertex(60,0);
vertex(60,20);
vertex(40,20);
vertex(40,60);
vertex(60,60);
vertex(60,80);
vertex(0,80);
vertex(0,60);
vertex(20,60);
vertex(20,20);
vertex(0,20);
vertex(0,0);
endShape();
pop();
}