For my Creative Coding class midterm, I spent a day coding 5 pieces of art in Processing (based on Java). These artworks use either a line pen (drawing in only straight lines) or an ellipse pen (drawing in only ellipses) to create the portraits. Creating different pens was a fun exercise in object oriented programming and inheritence. Creating different iterations using matrix manipulation was a fun art and computer graphics exercise.
To access this yourself, run the MeganB_CreativeCoding_Midterm.pde file in the Processing Development Environment, with all files downloaded in the same folder for the sketch. The program will randomly generate one of the 5 iterations of the art on each run.
I created a function to print out my mouse's x and y coordinates, so I could later draw lines based on my mouse clicks. Resulting image is below.
For this iteration, I used an inheritence pattern, creating an EllispePen with the same methods as Pen (the parent class) and LinePen, so that I could call .drawHat() (for example) on any Pen and it would use ellispes to make the hat for the EllipsePen (instead of the straight lines that the LinePen uses). Like iteration 0, I created a helper method that helped me map out where to put the ellipses based on the x and y coordinates of my mouse. This helped me draw the portrait.
I used motion in this iteration of the art, simulating wind blowing through my hair. To do so, I used the modulo operator (%) to the frame, every 3 frames, moving the position of my hair. I controlled the randomness of where my hair could move to by changing the x value for the ends of my hair by a random value between 0 and 20px.
A GIF is needed to show this art, but here is a still image below:
I created a larger hat my pushing a new matrix onto the stack and scaling it larger, and adjusting the positioning, before drawing the hat. I then popped the matrix off the stack, so that the rest of the methods would draw the rest of the image in its usual locations.
I flipped the matrix for a mirrored effect, for this last iteration in the art series.