Homework One

Homework One

My first homework assignment for Intro to Computation Media was to experiment with the Processing language/environment and create a screen drawing. I decided to draw a self portrait. I started with a basic oval shape, smaller circles for the eyes, and half an arc for the mouth. However, I was most interested in how to draw the hair. I decided to implement a for loop, where each iteration would draw a Bezier curve that would start at the crown of the head and end by the chin. I also utilized the Math.random() function to give each curve slightly different coordinates to look like strands of hair. Here was my first attempt:


I then continued to play around with the hair, eventually separating it out as its own function. I tweaked how Math.random() affected the coordinates, added more “strands”, and fluctuated the red value of each strand to try and emulate how real hair looks. After all of these changes my self portrait looked like this:


After feeling more satisfied about the hair, I turned my attention to the lips. I realized while the bottom lip is an arc, the top lip is a slightly more intricate shape. Using the PShape object, I created a polygon and connected five vertices. After a few final touches I had my completed (for now) self portrait:

Final Visual


Side note – because of the Math.random() function, every time I run the program I get a slightly different head of hair, the image above was just my favorite.