//Helen Wu
//Section A
//hdw@andrew.cmu.edu
//Project 4
function setup() {
createCanvas(400, 300);
background(255);
}
function draw() {
//curve one and two
for (var a = 0; a <= 41; a += 3) {
strokeWeight(1);
stroke(210);
line(a, 0, 3*a, height-a);
line(3*a, height-a, 5*a,300);
line(width-a, height, width-3*a, a-height);
line(width-3*a, a-height, -5*a, 0);
}
//three and four
for (var a = 3; a <= 500; a+=5) {
strokeWeight(1);
stroke(240,190,190);
line(30,0,3*a,height-a);
line(3*a,height-a,0,30);
line(width-30,height,width-3*a,-a);
line(width-3*a,-a,height,width-30);
}
//curve five and six
for (var a = 0; a <= 130; a += 3) {
strokeWeight(1);
stroke(245);
fill(170,210,240);
line (width-3*a, height-a, 5*a, 300);
curve(width-a, width, width-3*a, height-a, width-3*a, height-a, 5*a, 300);
}
//curve seven + eight
for (var a = 0; a <= 130; a += 3) {
strokeWeight(1);
stroke(245);
fill(170,210,240);
line (3*a, a, width-5*a,height-300);
curve(width-a, width, width-3*a, height-a, width-3*a, height-a, 5*a, 300);
}
//curve nine
for (var b = 3; b <=90; b += 5) {
strokeWeight(1);
stroke(160,210,230);
fill(255,255,255,0);
curve(0,0,b,b,b*4,b+5,400,400)
}
}
I struggled a bit on this week’s project. It’s hard to predict where the curves and lines will end up, so I went with a more experimental approach with my project. I do like the way the colors interact with each other, and the interesting texture created by the criss cross. However, I wish I could have the lines behave more uniformly.