Lab 8: Splines and Animation
CS 142: The Mathematics of Computer Graphics,Spring 2007
Due Date: Thursday, April 5
Goals
- Learn how to use splines to create curves and animation along the curves.
Review of Animation
To review how to do animation:
- Povray's online help: Section 2.3.8 Making Animations.
- Class webpage: animation.
Splines
Look at the examples at paths/splines
to see how one can create and animate along a spline. Download and run one of the examples. Try changing values
to see what happens.
- In this lab, you are to create a figure (e.g. person, animal) or vehicle (e.g. car, buggy, sled, etc) to animate along a "road".
The animation should loop, i.e. it should begin and end at the same place. For example:
Click image for animation. Code:car_path.pov
and car.inc.
Look through the code to understand what it does. We will discuss it in class, as well.
Create and name (using #declare) your vehicle or figure and place it in an include file.
On a piece of graph paper, draw the path your vehicle will follow, identifying specific points along the path that will be used to define the spline. There are several things to notice:
-
If you want your "road" to be three dimensional (ie. it has hills), then first create the road in 2 dimensions.
Once it is where you want it, change the y-values to add the third dimension.
-
To use the spline functions, you need to add the line
#include "transforms.inc"
- Just as you did with your lathe object, you will need to decide on the type of interpolation (e.g. linear, cubic).
If you use cubic, you need to include extra points at both ends. Re-read "2.3.1.1.1 Understanding The Concept of Splines"
in the online help to refresh your memory.
- When defining the spline, you need to specify the "value" at each point. In class, we will discuss what this means.
By changing these, you will change the speed at which your vehicle moves along sections of the spline.
-
Adjust the values associated with each point so that the vehicle is fast in some parts and slow in others.
Summary of what to turn in
No later than class time on Thursday, April 5, please do the following:
- Place your animation on your webpage.
- Email to gorr:
- your povray files (*.pov, *.inc) for the animation you created.
- DO NOT EMAIL THE ANIMATION FILE!
Please remember to place
"CS-142 Lab 8" in the subject line.
We will look at your animation during class on April 5.
[top] [Schedule]
[Home]