//Sun Min Kim
//Section E
//sunmink@andrew.cmu.edu
//project04-stringart
var x1 = 50; //x of line
var y1 = 0; //y of line
function setup() {
createCanvas(400, 300);
}
function draw() {
background(190, 100, 120);
var r = acos(height, width); //rotating angle
for (var i = 0; i <800; i +=30) {
strokeWeight(1);
rotate(r);
stroke(191, 61, 80); //top red line
line(400 , i / 8, i / 6, 2);
stroke(191, 20, 130); //left pink line
line(0, i / 3, i, 200);
stroke(130, 100, 140);
line(x1 + 250, y1, i/2 -300, 400); //left purple line
stroke(255);
line(x1 + 340, y1, i/2 -100, 400); //right white line
stroke(245);
line(x1 - 100, width/2 , i - 300, 300); //bottom grey line
}
}
For this project, I started off with simple straight lines because I was not sure how function for () is going to act on this problem. However, as I gained confidence in using for (), I could build more layers of strings step by step. It was very interesting to create curves without curve vertex function and I look forward to learning many other ways to build similar result.