YouieCho-Project-04-String-Art

sketch

/*Youie Cho
  Section E
  minyounc@andrew.cmu.edu
  Project-04-String Art*/

  var a = 7
  var b = 1

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

  function draw() {
      background(255, 179, 0);
      //pink sequence
      for (var i = 1; i < 1000; i++) {
          stroke(255, 69, 128);
          line(mouseX, i * a* mouseY / 100, i * a, height / 4);
      }
      //black sequence and rotation
      for (var i = 1; i <= 1000; i++) {
          stroke(0);
          rotate(90);
          line(mouseX, i * mouseY / 50, i * b, height / 2);
      }
      //yellow sequence and rotation
      for (var i = 1; i <= 1000; i++) {
          stroke(255, 215, 69);
          rotate(180);
          line(mouseX, i * mouseY / 25, i * a, height / 1.333333);
      }
      //purple sequence and rotation
      for (var i = 1; i <= 1000; i++) {
          stroke(174, 82, 255);
          rotate(270);
          line(mouseX, i * mouseY / 10, i * b, height);
      }
  }

I tried to play around with changing ratios to generate different sequences on different parts of the canvas, and rotated them to create complexity. I tried complex lines because interesting shapes and patterns can be generated through the movement of the mouse. It was challenging to understand the mechanism of loop, but I enjoyed how dynamic it could be.

Leave a Reply