Project 3: Dynamic Drawing

aysha-dynamic

var x = 1
var y = .75

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

function draw() {
    background(200, 100, 0); // orange background
    fill(mouseX);
    rectMode(CORNER);
    rect(0, 0, mouseX*x, mouseY*y); // top left rect
    rectMode(CORNERS);
    fill(mouseY);
    rect(450, 600, mouseX*x, mouseY*y); // bottom right rect
    fill(200, 75, 75);
    triangle(mouseX, mouseY*y, mouseX*1.25, mouseY+30,
        mouseX*.75, mouseY+30); // cursor triangle
}

It was interesting trying to find variables to incorporate other than mouseX and mouseY. I ultimately decided to go with something simple just because the layers of drawing looked cleaner.

Leave a Reply