Xu Xu – Project 04 – String Art

sketch

//Claire Xu
//xux1@andrew.cmu.edu
//Section B
//Project 04
function setup() {
    createCanvas(400, 300);
}

function draw() {
    background(0);
    for (var i = 0; i < width; i += 10){
        //horizontal colour
        stroke(255-(i/1.2),200-(i/1.2),100-(i/1.2));
        //horizontal curves set1
        line(i,mouseY, 0,i-mouseX);
        line(i,mouseY, 0,i+mouseX);
        //horizontal curves set2
        line(width-i, mouseY, width, i-mouseX);
        line(width-i, mouseY, width, i+mouseX);
        //vertical colour
        stroke(100-(i/1.2),200-(i/1.2),255-(i/1.2));
        //vertical curves set1
        line(i-mouseX, 0, mouseY+100, i);
        line(i+mouseX, 0, mouseY+100, i);
        //vertical curves set2
        line(i-mouseX, height, mouseY+100, height-i);
        line(i+mouseX, height, mouseY+100, height-i);

    }

}

For this project, I was experimenting with lines that would change and form patterns with the change of mouse. I was also playing with colour to create a gradient effect, and when certain patterns are formed some lines would look like dashed lines due to colour and crisscrossing patterns.

Leave a Reply