Gretchen Kupferschmid-Project 03- Dynamic Drawing

sketch

var angle = 0;

function setup() {
    createCanvas(480,640);
}
 function draw (){
    background(500 - mouseY, 128, 224);
    //ellipse grows big and changes color
    noStroke();
    fill(800-mouseY, 400-mouseX, 15);
    ellipse(width/2, height/2, mouseX, mouseX);
    //line rotates with mouse and color changes
    push();
    translate(width/2, height/2);
    rotate(radians(mouseX/3));
    strokeCap(ROUND);
    strokeWeight(50);
    stroke(147, 190, 500-mouseX);
    line(10,10 ,mouseX, mouseY);
    pop();
    //line 1 rotate clockwise and change color
    push();
    translate(mouseX, mouseY);
    rotate(radians((angle+.5)*2));
    strokeCap(ROUND);
    strokeWeight(50);
    stroke(500-mouseX, 154, 158);
    line(10,10 ,50, 100);
    pop();
    //line 2 rotates counterclockwise and change color 
    push();
    translate(mouseX, mouseY);
    rotate(radians((angle+.5)*-2));
    strokeCap(ROUND);
    strokeWeight(50);
    stroke(220, 500-mouseX, 158);
    line(10,10 ,50, 100);
    pop();
    //line 3 rotates fastest and changes color 
    push();
    translate(mouseX, mouseY);
    rotate(radians((angle+.5)*5));
    strokeCap(ROUND);
    strokeWeight(50);
    stroke(220, 150, 500-mouseX);
    line(10,10 ,50, 100);
    pop();

     
    angle = angle +.5;
 }

Leave a Reply