Here is your first assignment! Please complete it by January 1st 2012 (although I STRONGLY recommend you do it straight away before you forget your code skills!)Source: http://www.openprocessing.org/classrooms/?classroomID=1197
I want you to create one or more eyes. They can be human, alien, insect, robot, anything. There must be at least one, but you can make as many as you like! They must respond to the mouse in some way, either with mouse movement or button presses. Extra geek points awarded to those who implement both of these!
Good luck!
Hint : You may find my "Map" example sketch helpful.
(This exercise was inspired by (ie copied from) Casey Reas. :) )
My Answer
I submit my eye on December the 14th as I wanted to follow Sebs advice and get it in early, and hopefully make a good impression.
Process
I knew I wanted to do something unique and I figured I knew what that was going to be. We were given an example to use 'map()' to constrain the pupil to the eyeball. However, this meant that the pupils contraint would be a box and would never reach the corners of the eyeball. The example below exemplifies this trait.
To avoid this, after, literally, days worth of understanding my problem...

Click image to enlarge

Click image to enlarge
...I worked out the pupils logic would be based on two conditions: if the mouse was inside the eyeball, attach the pupil to the mouse; if the mouse was outside of the pupil, calculate the angle of the mouse from the center of the eyeball and position the pupil relative to it, but, within the eyeballs edge.
I later found out that after working out the manual maths with my Father (who's a lot better with numbers), I realised I could use Processing's 'atan2()' function to calculate the tangent I needed to position the pupil when the mouse was outside of the eyeball.
I later added some polish in the form of a starfield, which used a custom function (not yet covered by Seb) and a loop to draw my stars. The eye also has a rudimentary blink on mouse click as per asked for extra geek points!
Result
It received a nice comment from Seb!
Nice work, Simon! I particularly like how you're constraining the pupil to a circle - that's pretty tough!