// Simplified from Processing Examples | Basics | Math | Arctangent void setup() { size(300, 300); smooth(); noStroke(); } void draw() { background(50); drawEye( 50, 16, 80); drawEye(100, 85, 40); drawEye( 90, 250, 160); drawEye(150, 80, 40); drawEye(225, 160, 80); } // Draw an eye of size s at position (x,y) void drawEye(float x, float y, float s) { // Make the eye look at the mouse float angle = atan2(mouseY-y, mouseX-x); pushMatrix(); translate(x, y); fill(255); ellipse(0, 0, s, s); rotate(angle); fill(153); ellipse(s/4, 0, s/2, s/2); popMatrix(); } // START NO NOTES // code used to capture screenshots void keyReleased() { if(key == '`' && !online) save("sketch.png"); }