Elements of Graphics: Assignment Three


Due MIDNIGHT, Thurs. Oct. 2
This assignment will be your first animation in which objects move independently and will allow you to practice using transformations.

The files you should start with are:

ApplicationFrame.java (same as last time)
BufferingFrame.java (does double buffering)
AnimationFrame.java (provides an animation loop)
Flyby.java (beginings of an application)

Your assignment is to make a continuously repeating animation in which an object enters the left edge of the window, flys across the window, and exits the right edge of the window, then appears again at the left edge, flys across, and so on.

Getting this working with the rectangle is worth 80 points. One way to get into the 90-100 range is to be creative by using a recognizable flying object (football, UFO, sheep...) and draw a recognizable window, like the window on a house, on top of the flying object so that it looks like the object is flying past outside. Another way is to demonstrate an advanced understanding of using transformations to create motion, by making the object move in a more complicated way (for example, rotating by 2pi or doing a flip) while it flys across the screen. Another neat and technically challenging idea would be to make, for instance, a bug whose legs move as it crosses the window.

Here are some steps that you might want to follow to get the project working:

Step 1: Load the files and build the project.

Step 2: Comment out every reference to the rotation AffineTransform in the example provided, recompile and make sure the rectangle sits still in the center.

Step 3: Move the rectangle over to the left edge of the screen by changing the call to setToTranslation in the constructor.

Step 4: Use the rXform.translate() method in the timeStep method to translate the rectangle a few pixels to the right at every timeStep. Recompile and check that the rectangle moves across the screen, disappears off the right edge, and never reappears.

Step 5: Uncomment out the code that makes a rectangle which covers the window, and use its intersects() method to check at every timeStep whether any part of the flying rectangle is still in the window.

Step 6: When the rectangle exits on the right side of the window, reset its position to the left edge of the window. Recompile and make sure the rectangle flys across the screen, disappears, and comes back on the left.

Step 7: Edit README to describe what you did. Make any additional changes to the program and document them in README. Rename README to README3.

If you change ApplicationFrame.java, BufferingFrame.java, or AnimationFrame.java rename them ApplicationFrame3.java, etc. and turn them in along with your version of Flyby.java and README3.txt Flyby.java and README3.txt using turnin.


Don Fussell