Project 3 – Dynamic Drawing

drawingtlourie

function setup() {
    createCanvas(500, 500);
    background(0);

}

function draw() {
	background(0);
	stroke(200, 0, mouseY);
    strokeWeight(mouseX/15); //vertical red lines
    line(25, 0, 25, 500);
    line(75, 0, 75, 500);
    line(125, 0, 125, 500);
    line(175, 0, 175, 500);
    line(225, 0, 225, 500);
    line(275, 0, 275, 500);
    line(325, 0, 325, 500);
    line(375, 0, 375, 500);
    line(425, 0, 425, 500);
    line(475, 0, 475, 500);


    noStroke();
    fill(0, 0, 200, mouseY/2 + 20); //circls
    ellipse(100, 100, pmouseX-mouseX/3);
    ellipse(100, 400, pmouseX-mouseX/3);
    ellipse(400, 100, pmouseX-mouseX/3);
    ellipse(400, 400, pmouseX-mouseX/3);



    fill(200, 200, 0, mouseX/2 + 20); //circles
    ellipse(100, 100, pmouseY-mouseY/3);
    ellipse(100, 400, pmouseY-mouseY/3);
    ellipse(400, 100, pmouseY-mouseY/3);
    ellipse(400, 400, pmouseY-mouseY/3);

    push();

    translate(width/2, height/2);
    rotate(radians(mouseX));
    fill(255, 255, 255, mouseX/2+15); //white piece
    rectMode(CENTER);
    rect(0, 0, 255-mouseY, 1000); 

    pop();

	stroke(200, 0, mouseY);
	strokeWeight(mouseY/15); //horizontal red lines
    line(0, 25, 500, 25);
    line(0, 75, 500, 75);
    line(0, 125, 500, 125);
    line(0, 175, 500, 175);
    line(0, 225, 500, 225);
    line(0, 275, 500, 275);
    line(0, 325, 500, 325);
    line(0, 375, 500, 375);
    line(0, 425, 500, 425);
    line(0, 475, 500, 475);


}

Leave a Reply