Required Features for Virtual Mannequin Milestone 2


Due: Apr 4, 2024

This page requires JavaScript to display formulas correctly.

Virtual Mannequin Milesone 2

In this milestone, you will implement a simple animation editor for posing a virtual character into several keyframes, and then automatically interpolating the results.

The assignment is broken down into several features described below. Each feature is worth a number of points and will be graded separately (although later feature may build on and require a working implementation of earlier features). Your code should be correct and free of segfaults, deadlocks, or other buggy behavior. You will not be graded on software engineering (use design patterns and unit tests if they help you) but unreadable code is less likely to receive partial credit. You should not worry too much about performance or optimizing your code, but egregiously inefficient implementations of any of the features will be penalized.

(0 pts) Sanity Check and Build

Your submitted archive should build smoothly when make-skinning.py is run and should yield a web package that executes without fatal errors on common browsers (Chrome; Firefox; etc). Code that does not build or run will lose anywhere between 5 to 100 points, depending on the time and effort it requires the TA to fix your code. It is your responsibility to thoroughly test your submission.

(0 pts) Changes to Your Milestone 1 UI

You will need to make some changes to the Milestone I UI, so that there is enough space for new features.

(40 pts) Keyframe Animation

For this feature, you need to implement some basic control for adding keyframes, and playing an animation interpolating keyframes. Specifically, you need to implement the following keystroke functions:

Each keyframe consists of a set of joint rotations \(T_i\) (and, optionally, root joint translations, if you have implemented these). To compute a pose in between two keyframes, perform spherical linear interpolation (SLERP) on the rotation at each joint (and ordinary linear interpolation, LERP, on the root translations). If you do this interpolation correctly, joints will rotate with constant angular velocity from one pose to the next. There should be no "jumps" in the positions of the joints (or the vertices of the model)!

More details

There are several reasonable data structures and algorithms for storing and interpolating keyframes. Here's one possible approach:

  1. To implement kayframe animation, store the joint orientations at each keyframe. Record the rotations performed by the user in some type of keyframe data structure. If the user rotates a bone, only the orientation of that bone should be changed (and not the descendants). For example, if you rotate your shoulder joint, the entire arm moves, but only the shoulder joint (and not the elbow, wrist, etc) has changed orientation. The set of orientations over the entire skeleton is the data you need to save per keyframe.

  2. Code up a function that takes in a set of per-bone orientations and computes the corresponding skeleton configuration, in a way that lets you reuse the skinning algorithm to show the skeleton, and model, for an arbitrary pose specified by these joint orientations.

  3. To render the character at a time \(t\) in between two keyframes, use SLERP to interpolate the orientations of the two keyframes straddling time \(t\). Once you compute the interpolated rotation at each joint, you should be able to reuse the function implemented in Step 2 to render the model at any time \(t\). As noted above, your animation should play at a rate of one keyframe/second.

If you are uncertain about how the keyframing is supposed to work, the online reference solution has an implementation of the above keyframe animation features.

(30 pts) Keyframe Preview

Once you have implemented the functions from the previous section, you can record and play animations consisting of an arbitrary sequence of keyframes. But it is difficult to craft an animation without a visualization of the keyframes you have already saved---the features in this section make this task easier.

Implement the following keyframe preview feature:

It is well worth becoming comfortable with the technique of rendering to a texture, rather than the framebuffer: is is a key component of many effects including shadow mapping, reflections, and portable anti-aliasing.

(20 pts) Keyframe Management

The basic keyframe controls are unforgiving if you make a mistake, or wish to update/replace an existing keyframe. You will next implement a set of features that provides the user with a more sane UI.

Detect mouse events within the right preview panel, and implement the following functionality:

Optional Features

Implement at least 10 points of optional features. You may implement more for extra credit.

The list below contains pre-approved optional features (worth five points per 🎐 and ten points per 🔔)

All optional features must be fully described in your README file (including instructions for how to invoke the feature behavior) to receive credit.

Creative Scene (up to 20 pts extra credit)

You may save and submit particularly impressive animations that you create using your software system for extra credit. Put videos of your animations on YouTube and carefully describe any scenes you want considered for extra credit in your README file.