CMSC 110 (Introduction to Computing)
Fall 2011
Assignment #6
Due by 4:00 pm on Wednesday, November 23, 2011
Task: Design and implement an animated pseudo three-dimensional
scene. Create a sense of depth by reducing the size and linear velocity of
objects that are farther away from the viewer.
- Encapsulate all graphic objects in a custom class of your own design with a
method that draws the object on the sketch.
- All variables used by the graphic object to transform its coordinate system
should exist as fields inside the class. (x, y scale, angle)
- The drawing functions in your object's draw method must render your object at a
fixed location. I.e., use only numbers as arguments
to your drawing functions.
- All object animation must be generated by scaling, translating, and rotating the
coordinate system prior to drawing the object. Do not move or size your object by
changing the parameter values of your object's drawing functions.
- Your sketch must include examples of all three transformations:
scale, translate, and
rotate.
Here are some ideas to get you started:
- A long hallway filled with bouncing and rotating balls. The farther a ball is
from the viewer, the smaller it appears and the slower it bounces.
- A birdseye view of leaves falling from a tree. Leaves fall to ground, rotating
and getting smaller as they fall.
- A scene on a moon of Saturn where extraterrestrial insects with rotating
propellers race across a lake of methane. The farther the insect is from the
viewer, the smaller it appears and the slower it moves.
- A large rotating whirlpool that swallows anything dropped into it. Objects start
by slowly rotating about the center of the whirlpool at a large radius, but
increasingly speed up and shrink in size as the they get closer to the center of
the whirlpool, before being swallowed up entirely.
What to Hand in:
- Copy the entire sketch folder to your Dropbox folder.
- Make sure to name the sketch file/folder properly.
- Include the standard
header in your source code.
- Write a paragraph/description and include it in the header of the
main source code file for your sketch.
- Comment your code liberally with meaningful
statements that help explain what your code is doing.