Jessica Timczyk – Project 4 String Art

line drawing

// Jessica Timczyk
// Section D
// jtimczyk@andrew.cmu.edu
// Project-04-string art
function setup() {
    createCanvas(400, 300);   
}

function draw() {
    background(126, 25, 25);
    // variable set up
    var x1 = 0;
    var x2 = 0;
    var x3 = 0;
    var x4 = 0;
    var y1 = 0;
    var y2 = 0;
    var y3 = 0;
    var y4 = 0;

    // create a loop to draw many lines
    for( var i = 0; i <= 150; i ++) {
        // set new values for all the variables
        x1 += i;
        y1 += i;
        x2 += 2 * i;
        y2 += 2;
        x3 += 20;
        y3 -= i * 1/3;
        x4 = 2 * i;
        y4 = 2 * i;
        // orange lines
        stroke(246, 150, 14);
        strokeWeight(3 / 4);
        line(x1, y1, width, 70);
        // white lines
        stroke(255);
        strokeWeight(1/2);
        line(mouseX, y2, x2, height);
        // light brown lines
        stroke(142, 91, 53);
        strokeWeight(2);
        line(-mouseX + x3, y3, 400, 300);
        // dark brown lines
        stroke(49, 25, 7);
        strokeWeight(0.5);
        line(x4, y4, 210 - mouseX, 120);
        // grey lines
        stroke(68, 68, 68);
        strokeWeight(3/4);
        line(0, y2, x2, height);

    }
}

I really enjoyed this project because it allowed me to experiment with different parameters to see what would happen. As a result, my string art came about almost accidentally as I manipulated the parameters to see what they would do.

Leave a Reply