Project 4: String Art

Just try to imagine waking up to this in the middle of the night. Best 70s themed dreamscape ever. That’s the whole piece. That’s it. A portal to the disco dimension.

sketch
//Ilyas Khan
//Section D
//Entitled "Disco Portal"
//Why, you may ask, did I make it disco? Because I like disco, and I like random color changes.

count = 0;
function setup() {
    createCanvas(400, 300);
    background(0);
}
function draw() {
    background(0); //keeps the loop from getting messy
    frameRate(5); //makes it possible for one to perceive the color changes
    stroke(random(100,255),random(100,255),random(100,255)); //Makes this the portal to the disco dimension
    let count = 0;
    let y1 = 0;
    let y2 = 0;
    let x1 = 0;
    let x2 = 0;
    let x3 = 0;
    var limitX1 = 150;
    var limitX2 = 250;
    var limitY1 = 50;
    var limitY2 = 250;
    strokeWeight(0.5);
    for(y1 = -400; y1 < limitY1; y1 += 4.75){ //top of doorframe
        x3 = limitX2-(1.25*count);
        x1 = limitX1+(1.25*count);
        y2 = limitY1-(0.25*count);
        line(x1,y2,x1+300,y1);
        line(x3,y2,x3-300,y1);
        count += 1;
    }
    for(y1 = limitY1; y1 < limitY2+100; y1 += 7.75){ //left side of doorframe
        x1 = limitX1;
        x2 -= 4.5;
        y2 -= 7.75;
        line(x1,y1,x2,y2+300);
        count += 1;
    }
    for(y1 = limitY1; y1 < limitY2+100; y1 += 7.75){ //right side of doorframe
        x1 = limitX2;
        x2 = limitX2-(4.5*count);
        y2 += 7.75;
        line(x1,y1,1.05*-x2,-y2+50);
        count += 1;
    }
    for(y1 = 800; y1 > limitY2; y1 -= 9){ //floor
        x3 = limitX2;
        x1 = limitX1;
        y2 = limitY2-(0.05*count);
        line(x1,y2,x1+300,y1);
        line(x3,y2,x3-300,y1);
        count += 1;
    }

}

Leave a Reply