Project-04-StringArt

sketch

/*
* Rachel Griswold
* rgriswol@andrew.cmu.edu
* Section B
* Project 04
*
*/

function setup() {
    createCanvas(640, 480);
}

function draw() {
	background(140, 205, 255);

	for (var i = 0; i < 320; i ++) {
		var n = (i * 100);
		stroke(252, 258, 192);
        strokeWeight(1);
    	line(width/2, height/2, 0 - n/2, n);
    	// ^ bottom right hand yellow lines
    	line(width/2, height/2, 640 + n/2, n);
    	// ^ bottom left hand yellow lines
    	line(width/2, 0, 0 - n/2, n);
    	// ^ top right hand yellow lines
    	line(width/2, 0, 640 + n/2, n);
    	// ^ top left hand yellow lines
    }
    for (var i = 0; i < 240; i = i + 10) {
    	stroke(252, 89, 83);
    	strokeWeight(2);
    	line(width/2, i, width/2 + i, height/2);
    	// upper right hand red-ish curve
    	line(width/2, height - i, width/2 + i, height/2);
    	// bottom right hand red-ish curve
    	line(width/2, i, width/2 - i, height/2);
    	// upper left hand red-ish curve
    	line(width/2, height - i, width/2 - i, height/2);
    	// bottom left hand red-ish curve

        strokeWeight(1.5);
    	line(width, 0, width/2 + i, height/2);
    	// upper right hand red-ish "triangle"
    	line(width, height, width/2 + i, height/2);
    	// bottom right hand red-ish "triangle"
    	line(0, 0, width/2 - i, height/2);
    	// upper left hand red-ish "triangle"
    	line(0, height, width/2 - i, height/2);
    	// bottom left hand red-ish "triangle"
    }
}


Although I feel like I learned a lot more about lines and loops, I still felt quite frustrated during this process and I feel like I still need to practice much more to be fully comfortable. The almost halo-like effect from the yellow lines wasn’t intentional at first, but after I figured out how to do it I actually ended up liking it.

Leave a Reply