Paul Greenway – Project – 03

pgreenwa_dynamic_drawing

/* Paul Greenway
Section A
pgreenwa@andrew.cmu.edu
Project-03
*/


function setup() {
  createCanvas(640, 480);
  
}

function draw() {
  
  background(170, 190, mouseY);
  noStroke();
  
  
  let maxX = constrain(mouseX, 0, width-mouseX);
  
  // left circles 
  

  fill(170, 190, mouseY);
  //rotate(radians(angle));
  square(maxX, 0, mouseX/2, mouseY/5);
  
  fill(mouseY, 190, 200);
  //rotate(radians(angle));
  square(maxX, 50, mouseX/2, mouseY/5);
  
  fill(170, 190, mouseY);
  //rotate(radians(angle));
  square(maxX, 100, mouseX/2, mouseY/5);
  
  fill(mouseY, 190, 200);
  //rotate(radians(angle));
  square(maxX, 150, mouseX/2, mouseY/5);
  
  fill(170, 190, mouseY);
  //rotate(radians(angle));
  square(maxX, 200, mouseX/2, mouseY/5);
  
  fill(mouseY, 190, 200);
  //rotate(radians(angle));
  square(maxX, 250, mouseX/2, mouseY/5);
  
  fill(170, 190, mouseY);
  //rotate(radians(angle));
  square(maxX, 300, mouseX/2, mouseY/5);
  
  fill(mouseY, 190, 200);
  //rotate(radians(angle));
  square(maxX, 350, mouseX/2, mouseY/5);
  
  fill(170, 190, mouseY);
  //rotate(radians(angle));
  square(maxX, 400, mouseX/2, mouseY/5);
  
  fill(mouseY, 190, 200);
  //rotate(radians(angle));
  square(maxX, 450, mouseX/2, mouseY/5);
  
}

For this project I wanted to create a series of objects with different elements that could all be controlled by the mouse and would change simultaneously. I decided to use circles that would shift into rectangular lines as the mouse is moved.

Leave a Reply