CPSC310A
Video Game Development

Assignment 5

Articulated Animation

Details

Add articulated animation to the engine. The window class should maintain a constant frame rate by sleeping if not enough time has elapsed between frames. The engine should also have the following animation and body classes:

Animation

void load(string filename)

Loads the data in the specified animation file. Below is the format of an animation file:

ANIMATION_FILE:
    T number_of_joints R number_of_bones
    FRAME*
FRAME:
    time
    JOINT*
    BONE*
    --------------------------
JOINT:
    joint_name position_x position_y position_z
BONE:
    BONE_NAME orientation_x orientation_y orientation_z orientation_w
BONE_NAME:
    joint_name joint_name

void step(float time)

Advance this animation's current time by the specified number of seconds. The draw function should interpolate between frames, if the current time is between two frames.

Body

void set_bones(Clone *bones)

Set the clone objects that are used to draw the bones of this body.

void draw(Animation animation)

Draws this body transformed by the current transformation of the specified animation object.

void translate(float x, float y, float z)

Translate this body by the amount specified in each world-coordinate axis.

void rotate(float x, float y, float z)

Rotate this body about by the amount specified about the object's local axes.

void scale(float x, float y, float z)

Scale this body by the amount specified in each local-coordinate axis.

Extra

The following function may be useful, but is not required.

void Clone::draw(Animation animation)

Draws this body transformed by the current transformation of the specified animation object.

Test

Your program should include a game that includes animation of a motion captured articulated body.

Submission

Your program will be evaluated for both style and functionality. Submit your code as a tar file on cseval before class on Wednesday April 16th.