// Joanne Lee
// Section C
// joannele@andrew.cmu.edu
// Project-04
function setup() {
createCanvas(400,300);
background (255);
}
function draw() {
var leftX1 = 0;
var leftX2 = 0;
var leftY = height/40
var rightX1 = 400;
var rightX2 = 400;
var rightY = height/40;
// step sizes
var vertStep = height / 40;
var horizStep1 = width / 15;
var horizStep2 = height / 150;
var i = 0;
strokeWeight(0.1);
//bottom left curve loop
for (i = 0; i < 40; i ++) {
stroke(0,80,115,10);
line(leftX1, 300, leftX2, leftY);
// x-values move in opposite directions
leftX1 += horizStep1;
leftX2 -= horizStep2;
leftY += vertStep; // increase y2 value
}
// bottom right curve loop
for (i = 0; i < 40; i ++) {
stroke(38,128,167,15);
line(rightX1, 300, rightX2, rightY);
// x-values move in opposite directions
rightX1 -= horizStep1;
rightX2 += horizStep2;
rightY += vertStep; // increase y2 value
}
// code reset
leftX1 = 0;
leftX2 = 0;
leftY = 300 - vertStep;
// top left curve loop
for (i = 0; i < 40; i ++) {
stroke(38,128,167,15);
line(leftX1, 0, leftX2, leftY);
// x-values move in opposite directions
leftX1 += horizStep1;
leftX2 -= horizStep2;
leftY -= vertStep; // decrease y2 value
}
// code reset
rightX1 = 400;
rightX2 = 400;
rightY = 300 - vertStep;
// top right curve loop
for (i = 0; i < 40; i ++) {
stroke(130,175,195,40);
line(rightX1, 0, rightX2, rightY); // decrease rightY value
// x-values move in opposite directions
rightX1 -= horizStep1;
rightX2 += horizStep2;
rightY -= vertStep; // decrease y2 value
}
}
The most difficult part of this project was determine what kind of shape I wanted to make. However, ultimately I decided that I wanted to create something that has a bit of depth as well as looks like something that is opening up. I am happy with the results and hope to be able to create more complex results in the future.