EYE-SEE-YOU (generated eye)
After I stumbled upon this amazing eye animation created using Blender3D I was thinking how immersive such an eye would be when it would react on people when walking in front of a screen? The dilating of the pupil, makes this eye more humanly than I could have thought. So I started thinking on how to create such a eye with code so I can control the dilation of the pupil and the movement of the eye based on some interaction. To make it a bit more easy I'm creating two meshes; one for the pupil and one sphere for the eye ball. The eye is almost finished and the next step will be hooking up ofxOpenNI (kinect, NITE) and do some simple image analysis to track a user, get his distance and base the dilating of the pupil on these values.

I started coding a sphere based on spherical coordinates as described by Wikipedia. I could have used the (deprecated gluSphere, though I wanted to be able to tweak the sphere myself.. for example an eye is not completely round. When generating the vertex positions myself I was able to tweak the values to give the eye a shape I want. I had to rewrite the sphere class a bit because I had to use quads for texturing and needed to find the correct vertex indices. The pupil mesh is basically just a tiny part of the sphere. I control the dilation by changing the theta value of the spherical coordinates. By incrementing this theta value I change the step size of each stack.

After I got the sphere and pupil meshes working I started with the vertex and geometry shaders. I had done some simple Lambertian (diffuse) shading before but now I had to use normalmapping to give the eye some sort of rough structure and to make the veins pop-out. Also I use a cubemap to give the eye a "glossy" effect.

I still have to add the user-tracking code which I'll do as soon as I've got some more time.