cbjohnso line drawing

sketch

/*Carley Johnson
Section E
cbjohnso@andrew.cmu.edu
Lab 3
*/

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

function draw() {
    background(200);
    for (var i = 20; i < 400; i += 20) {

      stroke(30, 70, 80)
      line(1.2*i, 17, 5*i, 100);

      line(1.5*i, 120, 1.2*i, 300);

      line(.7*i, 0, 1.1*i, 30);

      stroke(155, 190, 20)
      line(.6*i, 0, 1.1*i, 140);

      line(.7*i, 25, 1*i, 145);

      line(.7*i, 30, 1.8*i, 160);

      line(.8*i, 50, 2.4*i, 160);

      stroke(150, 70, 10)
      line(0*i, 300, 2.4*i, 160);

      line(1*i, 240, 6*i, 300);

      stroke(30, 50, 50)
      line(0*i, 240, 2*i, 100);

      line(.3*i, 200, 8*i, 100);

      
}
    
}

This project was not one of my favorites, as I missed a few of the classes on for() function and had to do more in depth learn-by-doing. I also just don’t think string art is super attractive. HOWEVER, now that I know the for() function I can definitely think of other uses for it, as incrementation is really helpful and can also simplify some tedious coding.

Leave a Reply