CS 315 Homework 4 - Dance, CubeBot! Dance!

Due Fri Oct 17 at 11:59pm

Overview

You will be adding the ability to interact with your rendered scene in the previous assignment. You will add functionality so that the user can move parts of your robot and put him into cool poses. Next, you will be adding the ability to "save" these poses as key frames in an animation--which you will then be able to play back and watch!

You may work individually or in pairs on this assignment--with well-organized code, you should easily be able to swap out either partner's robot!

Objectives

Necessary Files

This assignment will build upon your last; thus you'll need a copy of that project!

I have included an updated .html file (with some simple CSS styling), which you can find in the cs315_hwk4.zip file. Put the style/ folder in the top level directory of your project. Any changes you made to the html file for homework 3 you should re-include in this one (though you will need to modify the instructions somewhat!) I have also included a anim_controls.js class to handle some of the jQuery stuff for you; put this in the top-level directory of your project.

There is also a new README.txt for this assignment. Please fill it out and submit it with the rest of the assignment!

Assignment Details

There are a few different parts to this assignment, all of which will work together. I've listed them below in a possible order of completion, though you may need to jump around a bit

1. Posing with Quaternions

In order to allow your robot to animate smoothly, you should define its pose in quaternions which can then be smoothly interpolated (as we discussed in class). This will involve refactoring your code:

2. Adjusting the Pose

Now that you're using the correct data format, it is time for the hard work of allowing the user to pose the robot. To do this, you will be extending the trackball rotation algorithm you implemented in hwk 3 to allow you to rotate not just the camera, but each part of the robot!

Once this is done, the user should be able to select any body part's radio button, and then click and drag to rotate that part on the screen. And because you have a working hierarchical transformation, rotating a pivot should apply to all the children as well!

3. Saving Keyframes

Once the user can give the robot a particular pose, you should add a way to save that pose as a keyframe for your robot's animation.

4. Animating the Robot

Finally, you can animate your robot! This will involve going through each of your animation keyframes and interpolating between them!

5. Loading an Animation

It would be nice to be able to save and load a specified animation (set of keyframes), so that you don't have to continually repose your robot, and so that you can share animations with your friends!

Extensions

Not a lot of time for extensions on this one. It might be neat to use the viewport to show the individual keyframes as they are saved (e.g., at the bottom of the canvas).

Submitting

BEFORE YOU SUBMIT: make sure your code is fully functional! Grading will be based primarily on functionality. I cannot promise that I can easily find any errors in your code that keep it from running, so make sure it works.

Upload your entire project (including the lib/ folder) to the Hwk4 submission folder on vhedwig (see the instructions if you need help). Also include a filled-in copy of the README.txt file in your project directory!

The homework is due at midnight on Fri Oct 17.

Grading

This assignment will be graded out of 25 points: