Sean Leo – Project 03 – Dynamic Drawing

I wanted to create an dynamic drawing that was minimal and focused more the on the composition and geometries of the basic shapes. Stopping your mouse anywhere on the canvas will produce a new composition, color and relation between all the parts. Also it’s really satisfying to just roll your mouse around on the canvas!

project-03

//Sean B. Leo
//Section C
//sleo@andrew.cmu.edu

//Project-03
function setup() {
    createCanvas(600, 480);
    strokeWeight(4);
  }
  
  function draw() {
    background(0);
    noFill();
    //scale mouse X value from 0-175
    var a = map(mouseX, 0, width, 0, 175);
    //scale mouse Y value from 0-175
    var b = map(mouseY, 0, height, 0, 175);
    //print(a);
    //contrary motion
    var inX = width - mouseX;
    var inY = height - mouseY;
    //rectangle transformations
    stroke(a, 0, 100);//scales R value
    rect(inX, inY, inX, inY);
    //circle transformations 
    stroke(100, a, b);//scales G B values
    ellipse(width/2, height/2, a, b);
    //triangle transformations
    stroke(0, a, 100);//scales G values
    triangle(width/2, mouseX / 2, mouseY / 2, mouseY / 2, mouseX, mouseY);
  }

Leave a Reply