/* Kimberlyn Cho
Section C
ycho2@andrew.cmu.edu
Project 5 */
function setup() {
createCanvas(500, 400);
background(255);
noLoop();
}
function draw() {
var ex = 50 // x position of first pupil
var ey = 40 // y position of first pupil
var ew = 15 // size of pupil
for (var y = 0; y < 8; y++) {
for (var x = 0; x < 6; x++) {
var eyex = ex + x * 80 // x position of arrayed pupils
var eyey = ey + y * 45 // y position of arrayed pupils
//eyeballs
fill(0, x * 50 + 50, y * 30 + 100);
strokeWeight(0);
ellipse(eyex, eyey, ew * 2, ew * 2);
//pupils
fill(0);
ellipse(eyex, eyey, ew, ew);
//reflection on pupils
fill(255);
ellipse(eyex + 3, eyey - 3, ew / 2, ew / 2);
//eye
noFill();
stroke(0, x * 30 + 50, y * 50 + 100);
strokeWeight(3);
arc(eyex, eyey + 22, ew * 5, ew * 5, PI + QUARTER_PI, -QUARTER_PI, OPEN);
arc(eyex, eyey - 22, ew * 5, ew * 5, QUARTER_PI, PI - QUARTER_PI, OPEN);
};
};
};
I was inspired by the static yet varied nature of human eyes for this project. While every eye in the pattern has the same elements (pupil, reflection, etc.), each eye has its own combination of colors that make it unique, as do humans.