Aaron Lee – Project 04 – String Art

sketch

/*
Aaron Lee
//Section C
//sangwon2@andrew.cmu.edu
Project-04-String Art
*/

function setup() {
createCanvas(400, 300);
}


function draw() {
 
  background( mouseX, mouseY, 100);//backgrond chages color
  var stepx = 10;
  var stepy = 20; 

      for(var i = 0; i < 100; i = i + 1) {
         line(width - (mouseX * i / 50), 0, width, height - (mouseY * i /50)); //top right curves
         line(0, width - (mouseX * i / 50), height - (mouseY * i /50), width); //bottom left curves
      }

      for(var i = 0; i < 100; i = i + 4) {
         line(mouseX, mouseY, i, i / 50);  //top straight lines
         line(i / 50, i, mouseX, mouseY);  //bottom straight lines
      }
}

This project was more of a try and error process. My initial formula was not intriguing as I had wished. Thus I had to constantly make changes until I got this result.

Leave a Reply