Project 3: Christmas assignment

by samscaife on Tuesday 10 January 2012

Our tutor Seb has set up a classroom for us on openprocessing. This is a place where he can post working examples of the projects we worked on in the day and we can look at the outcome and also review the code so we can remind ourselves how parts of it work. It also a space where he can put up assignments for us to do and he gave us one to do over the Christmas holidays so that we would not forget everything we had learnt so far.

We where asked to create a pair of expressive eye. These eyes should at least one of two thing, follow the mouse as it moved around the screen and blink if you clicked. we could create the eyes to look like anything we wanted really with suggestions of human, alien, insect, robot!
I chose to do mine as a pair of human eyes. I wanted them to look bold and graphical so I chose to use the beginShape() function to let me build up some interesting polygons. I chose to build the eyes using variables of fraction of the width and height of the project so that once I had finished building I would be able to alter the size of the project and by doing so change the appearance of the face.

To get the eyes to follow the mouse I use a function called  map()  which allows you to change values from their current range to another one. By doing this I could change the values of the mouseX and mouseY positions to be changed to the area I wanted my pupil to move around in.
I chose a bland pale skin tone then had dark areas around the eyes which could be viewed as the sunken area around your eyes or are some form of makeup or warpaint.

For the blink I use a boolean variable which is either true or false to test if the eyes where closed or not in an if statement, it would then change the position of the lower part of the top eyelid covering the eyeball.


You can view the full project here.

Leave your comment