danakim-Project-05

sketch

//Dana Kim
//danakim@andrew.cmu.edu
//Section D
//Project-05

function setup() {
  createCanvas(480, 480);
  background(256);
}

function draw() {
   for ( var i = 0; i < 480; i+=240){ //repeats pattern in y-direction
      for (var x = 0; x < 500; x+=48){ //repeats shapes in x-direction
        var h1 = random(30, 90); //randomized height for lines going down
        var h2 = random(130, 190); //randomized height for lines going up

        stroke((x+20)/.5, x/1.5, x/3);
        strokeWeight(48);
        line(x, 0+i, x, h1+i); //first row of lines
        line(x, 240+i, x, h2+i); //second row of lines

        stroke((x+20)/.5, x/1.5, x/3);
        strokeWeight(1);
        fill(256);
        ellipse(x, (h2-10)+i, 48, 35); //circles that rest on lines
        }
      }
    noLoop();
}

This project was fairly easy. I had the most trouble with figuring out how to get the line colors to be a gradient. I had originally wanted to make each line have a gradient color to make it seem more like cylinders. Instead, I made each line a solid color so it would be easier to distinguish each cylinder. The heights of each cylinder was randomized.

Leave a Reply