CMSC 491/691: Computer Animation

Assignment 1
Forward Kinematics
Initial submission September 10, 2017
Due September 17, 2017

Before you start

You will be doing your work this semester in a class git repository. Before you get started on any of the assignments, you should fetch yourself a copy of your personal repository following these directions. Your personal class respoitory on the UMBC GL/Linux systems is /afs/umbc.edu/users/a/d/adamb/pub/491/your-user-name.git

To make sure you do not have last-minute problems, you must commit and push something to your repository by Sunday, September 10th. This be anything from an update to the readme to the completed project.

The Assignment

For this assignment, you must write a C or C++ program that will read a bone forest (.bf) file and a pose (as a .dmat) file that contains a kinematic hierarchy and a set of poses and outputs the locations of the joints in the kinematic hierarchy.

You can run my program here:

~adamb/public/ForwardKinematics/forwardKinematics ogre-skeleton.bf pose.dmat output-%05d.pose

Input/Output

filename description
ogre-skeleton.bf .bf "bone forest" file containing the skeleton description. This is a crude file format that stores joint vertex rest positions, corresponding column indices into the weights matrix, and indices of parent joints
pose.dmat"dense matrix" containing the poses. Each pose is given as a set of 69 "Euler angles" for 23 3-degree-of-freedom ball-and-socket joints.

More details

There are two parts to this assignment, (1) designing data structures to store the skeleton hierarchy and pose data and (2) mapping the pose data given in local coordinate frames to world space. This assignment should not be particularly difficult, my program is less than 100 lines.

I encourage you to design your own data structure, but I created a vector of joints, where each one stored its parent, children, and offset from its parent. I just stored the frames as

std::vector < std::vector < double> > 
where the outer vector was frames and the inner vector store Euler angles. Nothing too fancy.

I traversed the kinematic chain recursively, starting from the root, using the call stack to store the transformation stack. An iterative approach would work too.

I use the SlEulerAngToMatrixXYZ to map from Euler angles to a 3x3 rotation/transformation matrix.

Extra Credit

For 25 additional points, interpolate between each pair of poses if the command line switch "-i nframes" is passed to the program, where nframes are interpolated between each pair of poses. E.g.
~adamb/public/ForwardKinematics/forwardKinematics -i 30  ogre-skeleton.bf pose.dmat output-%05d.pose
For 15 additional points, interpolate using qlerp between each pair of poses if the command line switch "-q nframes" is passed to the program, where nframes are interpolated between each pair of poses. E.g.
~adamb/public/ForwardKinematics/forwardKinematics -q 30  ogre-skeleton.bf pose.dmat output-%05d.pose

What to turn in

Turn in this assignment electronically by pushing your source code to your class git repository by 11:59 PM on the day of the deadline. Do your development in the proj1 directory so we can find it. Be sure the Makefile will build your project when we run 'make' (or edit it so it will). Also include a README.txt file telling us about your assignment. Do not forget to tell us what (if any) help did you receive from books, web sites or people other than the instructor and TA.

Check in along the way with useful checkin messages. We will be looking at your development process, so a complete and perfectly working ray tracer submitted in a single checkin one minute before the deadline will NOT get full credit. Do be sure to check in all of your source code, Makefile, README, and updated .gitignore file, but no build files, log files, generated images, zip files, libraries, or other non-code content.

To make sure you have the submission process working, you must do at least one commit and push a week before the deadline.