Saint Louis University |
Computer Science 144
|
Dept. of Math & Computer Science |
My generating code is linked in the right column, however you may choose to download a single zipfile with the entire collection, and place it within your Processing sketchbook.
The first set of images are examples discussed in class.
Sketch | My Code |
---|---|
Version in which we compute all geometry ourselves:
regular_polygon.pde Version akin to our text book, using Processing transformations to place the sign. stop_sign_transform.pde |
|
star.pde | |
mandala.pde
If interested, I offer this really cool animation of how the mandala is made (although it is linked as a separate web page since it may be a bit taxing on the cpu). |
|
great_seal.pde |
I'll conclude today by leaving you with a challenge (spoiler attached). Design a function that draws a flower with a given number of elliptical petals, centered around the origin. Use the following function signature:
void flower(int numPetals, float petalLength, float petalWidth, color petalColor, color centerColor)
Note that there is a subtle difference between the design of the flowers on the left versus the right. Can you spot the difference? Which one looks better toyou?
Sketch | My Code |
---|---|
flower.pde |
And if you need one more challenge, try to reimplement the great seal, but this time choosing the angles for the centers of the characters in proportion relative to the individual textWidth() for each character.
Sketch | My Code |
---|---|
great_seal_improved.pde |