//Elizabeth Wang
//elizabew
//Section E
//Project-04: String Art
// for (var VARNAME = STARTINGVALUE; VARNAME < LIMIT; VARNAME += INCREMENT) {
// WHAT_TO_DO;
// }
function setup() {
createCanvas(400,300);
background(0);
}
function draw() {
for (var x = 0; x <= 300; x += 10){ //looping lines with a spacing of 10 each time
stroke(255);
strokeWeight(.01);
line(0, height - x, x * 1.5, 0); //upperleft
line(width, x * 1.5, height - x, height); //lowerright
line(0, x * 1.5, height/4 + x, height); //left side of eye
line(height, height/20 + x, x * 1.5, 0); //right side of eye
noStroke();
fill(255);
ellipse(180, 160, 80, 80);
}
}
Reflection
At the beginning of the project, instead of coming up with an idea of what to make with lines, I wanted to practice getting used to using the for() function and seeing how it affects the shape and look of the lines. After a while, I felt that what I was beginning to form looked like an eye, and so I decided to work towards that as the goal of my project.