Claire Lee – Project 04 – String Art

sketch

/*
Claire Lee
15-104 Section B
Project - 04
*/

var canvasW = 400;
var canvasH = 300;
var lineR = 0;
var lineG = 255;
var lineB = 200;

function setup() {
    createCanvas(canvasW, canvasH);
    strokeWeight(1);
}

/*function draw() {
    background(0);
    for (var i = 30; i < 600; i += 30) {
        fill(255);
        line(i, 0, 1.5*i, 300);
    } 

}*/

function draw() {
    background(0);
    for (var i = 20; i < 400; i += 20) {   
      line(i, 0, canvasW, 0.5*i);
      stroke(lineR + i, lineG, lineB); 

      line(canvasW, canvasH, i, 0);
      stroke(lineR + i, lineG, lineB);

      line(0, i, i - 5, canvasH); 
      stroke(lineR + i, lineG, lineB);

      line(canvasW, i, -0.5*i, canvasH);
      stroke(lineR + i, lineG, lineB);
    }

}

For my string art project, I tried to construct an abstract piece based on the form of a leaf. Initially, it was a little difficult to understand how the relationships of the lines and edges changed with respect to i, but it was fairly easy once I figured out how to draw the first curve. I also tried to incorporate gradients into the coloring of this piece as well, and was very satisfied with the result.

Leave a Reply