Project-03-Dynamic Drawing

proj3Download
// Amyas Ryan   Section A

function setup() {
    createCanvas(600, 450);

}

function draw() {
    background(62, 100, 144);
    noStroke();

    //top ellipses
    let tone = 255 - (mouseY / 6)
    fill(tone , 105, 22);
    ellipse(100, 0, 100, mouseY * 1.5);
    fill(235, tone, 22);
    ellipse(300, 0, 100, mouseY * 1.5);
    fill(235, 105, tone);
    ellipse(500, 0, 100, mouseY * 1.5);

    //bottom ellipses
    fill(185, tone, 106)
    ellipse(0, 450, 100, mouseY * 1.5);
    fill(tone, 49, 106)
    ellipse(200, 450, 100, mouseY * 1.5);
    fill(185, 49, tone)
    ellipse(400, 450, 100, mouseY * 1.5);
    fill(tone, 49, tone)
    ellipse(600, 450, 100, mouseY * 1.5);

    //squares
    let opacity = 255 - (mouseX / 6);
    let sw = (mouseX / 4);
    stroke(255, 255, 255, sw);
    push();
    translate(100, 110);
    rectMode(CENTER);
    rotate(radians(mouseX));
    scale(mouseX / 30);
    fill(172, 68, 58, opacity);
    rect(0, 0, 20, 20);
    pop();
    push();
    translate(300, 220);
    rectMode(CENTER);
    rotate(radians(mouseX));
    scale(mouseX / 30);
    fill(242, 187, 49, opacity);
    rect(0, 0, 20, 20);
    pop();
    push();
    translate(480, 50);
    rectMode(CENTER);
    rotate(radians(mouseX));
    scale(mouseX / 30);
    fill(219, 163, 175, opacity);
    rect(0, 0, 20, 20);
    pop();
    push();
    translate(430, 350);
    rectMode(CENTER);
    rotate(radians(mouseX));
    scale(mouseX / 30);
    fill(212, 108, 64, opacity);
    rect(0, 0, 20, 20);
    pop();

}

Leave a Reply