/*Julie Choi
15-104 Section E
jjchoi@andrew.cmu.edu
Project-04
*/
function setup() {
// setup canvas
createCanvas(400, 300);
}
function draw() {
background(255);
// declare varables along the edges
var x1 = width/4;
var x2 = width/2;
var y1 = height/2;
var y2 = height/3;
// start a for loop for lines
for (var i = 0; i < 35; i++) {
strokeWeight(1.5);
stroke(255, 0, 0);
line(width - x1, 0, 0, height - y1);
stroke(0, 0, 255);
line(width, height - y1, width - x2, height);
stroke(0, 255, 54);
line(x1, 0, width, height - y2);
stroke(255, 0, 234);
line(0, height - x1, y2, height);
stroke(90, 0, 255);
line(x1, 0, 0, y2);
stroke(174, 255, 0);
line(0, height - y2, width - y2, width - x1);
stroke(255, 0, 0);
line(height - x1, 0, width, y1);
x1 += 6;
y1 -= 6;
y2 -= 6;
x2 += 6;
}
// draw eye shape
stroke(255);
strokeWeight(1);
translate(-10, 10);
beginShape();
vertex(130, 150);
bezierVertex(130, 150, 200, 70, 270, 150);
vertex(130, 150);
bezierVertex(130, 150, 200, 230, 270, 150);
endShape();
stroke(0);
strokeWeight(1.5);
line(130, 150, 270, 150);
// draw pupil
fill(0);
stroke(255);
ellipse(width / 2, height / 2, 50, 50);
ellipse(width / 2, height / 2, 30, 30);
}
I enjoyed creating consecutive lines in different positions through this project. I ended up creating an Illuminati sign as I explored different compositions. I am satisfied with my final result and learned a lot from this exercise.