Assignment 2: Inverse Kinematics
Due Date: Oct 13
Grade Value: 15%


Your assignment is to implement two ways of doing inverse kinematics on a character's arm. This is useful for posing a character. In our case, we ask that you pose the end point of the right arm (the position at the end of the rfingers bone, id 29) to match pre-specified target positions. We provide you with a similar motion viewer as in assignment 1. Since we do not need to display motion here, you should use the pose.AMC file and ignore the playback, rewind, and pause buttons. A file called IKtargets.txt (hardcoded name) contains all the targets the end of rfingers should move to. These targets are loaded when you load the motion file. The toggle targets button moves along the list of targets, highlighting the current one by coloring it green. The intention is that when you press the run IK button, the end of rfingers should move to the current green target. You can create additional buttons for the two different IK schemes.


Your task is implement these two IK methods:

You can change the joint angles starting from the joint in between the rclavicle (24) and rhumerus (25) bones. Everything below this in the skeleton hierarchy can also be changed. You can change the target points by changing the IKtargets.txt file. We will be testing your code on different target points.

Hand in :

Source Code:

The starting source code for the assignment is at /afs/

You may have to do the following to get the code running:
setenv LD_LIBRARY_PATH /afs/cs/academic/class/15464-f05/lib/

Here is the skeleton hierarchy. The one in assignment 1 has a small error in it.

Source code structure and description:

The code in the "src_viewer_IK" directory is similar to the code in assignment 1. Here is a description of the files:


If you enter -2 in the joint box, you will see a dark grey sphere drawn at the end of the rhand bone, and red, green, and blue spheres drawn to represent the vectors in the local axes.
The code that does this is in the redisplay() method in player.cxx. Similarly, you can draw spheres in the environment for debugging if necessary.
If you print out these values, they will make no sense. This is because the whole environment is transformed if you move the camera. And so these values get transformed too. You should not have to worry about this. Just remember that the values are consistent with each other.

Extra Credit:

Here are some ideas for extra credit.
Last Modified: 09/20/05