Sarah Choi – Project – 04 – Generative Art

project-04

//Sarah Choi 
//Section D
//sychoi@andrew.cmu.edu
//Project-04

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

function draw() {
    background(0);
    for(var i = 0; i < 400; i += 2) {
        stroke(255);
        strokeWeight(0.2);
        line(i, mouseY / 2 + 200, 400, - i);
    }
    for(var a = 0; a < 400; a++) {
        fill(255, 0, 0);
        strokeWeight(0.5);
        line(a, - a + mouseX / 5, 400, - a);
    }
    for(var b = 0; b < 400; b += 5) {
        stroke(255, 255, 0);
        strokeWeight(0.5);
        line(mouseX - 150, - b, 400, b);
    }
    for(var c = 0; c < 400; c += 5) {
        stroke(255, 0, 255);
        line(mouseY - 100, c, 400, - c);
    }
    for(var d = 0; d < 400; d += 0.5) {
        stroke(255, 100, 100);
        strokeWeight(0.2)
        line(d, - mouseY, 400, d);
    }
}

Using string art, I wanted to create abstract art playing around with primary and complimentary colors along with a black background. I wanted my piece to follow the mouse, so it would be more interactive with the audience. 

Leave a Reply