CMSC 110 (Introduction to Computing)
Spring 2011
Assignment#6
Due
before start of class on Thursday, April
12, 2011
Due before start of
class on Thursday, April
14, 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. The drawing
functions in your object's draw method must render your object at a
fixed location. Do not move or size your object by changing the
parameter values of your object's drawing functions. All object
animation must be generated by scaling, translating, and rotating the
coordinate system prior to drawing each object.
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.
Hints:
- Keep it simple at first. Start with something basic, get it
working, and then build upon it piece by piece, each time ensuring it
is working before you move on to the next piece.
- Start with a hand-drawing of what you want.
- START EARLY!!! I cannot emphasize this enough.