/*
Eliza Pratt
Section E
elpratt@andrew.cmu.edu
Project-04
*/
function setup() {
createCanvas(400, 300);
}
function draw() {
background(0);
var y = 0;
var x = 0;
var y1 = height/2;
var x1 = width/2
var y2 = height/4;
var x2 = width/4;
//dark gray curves
for (var z = 0; z < 35; z++) {
stroke(180 - x2/2);
//bottom left curve
line(width - x2, height, 0, height - y2);
//top right curve
line(x2, 0, width, y2);
x2 += 6;
y2 += 6;
}
//gray center curves
for (var i = 0; i < 44; i++) {
stroke(x/2);
//bottom center curve
line(width - x, height - y, x, height);
//top center curve
line(x, y, width - x, 0);
x += 7;
y += 7;
}
//white curves
for (var w = 0; w < 20; w++) {
stroke(255);
//bottom right curve
line(x1, height, width, height - y1);
//top left curve
line(width - x1, 0, 0, y1);
x1 = x1*1.04;
y1 = y1*1.04;
}
}
Although confusing at first, I had a lot of fun with this assignment! While it’s frustrating when the lines don’t map out the way you want them to, it was always a surprise when I refreshed my browser. I also played around with adjusting the stroke color in my for loops, which led to some pretty cool gradients!