dayoungc- Project-03- Dynamic Drawing

sketch

//Dayoung Chung
//SECTION E
//dayoungc@andrew.cmu.edu
//Project-03

function setup() {
   createCanvas(640, 480);
    //background(0);
}

function draw() { 

/*
   stroke(255);
   strokeWeight(3);
   for (var i = 0; i < 20; i++) {
       for (var j = 0; j < 20; j++) {
           line(i*30+i, j*30+j, i*30-i, j*30-j);
       }
   }
*/

  background(0);
  //i: x j:y
  for(var i= 0; i<20; i++) {
      for (var j= 0; j<20; j++) {

     
           stroke((255 - (i+j)*5)*mouseX/100, (255 - (i+j)*5)*mouseX/400, (255 - (i+j)*5)*mouseX/600);
           //stroke(202,192,253);      
           strokeWeight(6 * mouseY/600);
           line(i*30 + (30*mouseX/600), j*30+(30*mouseY/600), i*30+30-(30*mouseX/600), j*30+30-(30*mouseY/600));
      }
  }
}

I made a large number of lines to make a pattern of my own. Wave your mouse around to adjust the color and shape of lines.When you move your mouse to right or down, the lines get thicker. And when you move your mouse to left or up, then the lines disappear. In future, I would like to learn more about mapping and making angles to make a complicated pattern.

Leave a Reply