Due Wednesday Oct 27 2005, in class. Worth 12%.
Template code for the reading and playback of BVH files
is available at:
http://www.cs.ubc.ca/~van/cpsc526/Vsep2004/mocap.tar.gz
This code will run on either Windows or Linux. The system
you run it on should have the glut and OpenGL libraries installed.
There are multiple example BVH files in the bvh subdirectory with the template code. Right now the reader will only read one of these at a time (see main.cpp for where this happens). A good first step is to adapt this to be able to read in multiple compatible BVH motion clips, which can then form the basis for the motion graph. Also note that many of the BVH files do not share a common skeleton -- they may differ in terms of structure (number of joints) as well as size. And they also differ in sampling rate.
You could choose to use only the files which share a similar structure or you could attempt to convert motions to be playable on a single common character. Another alternative is to use the CMU Motion Capture Database (Google will find it), which has multiple motions for the same subject. The data here is stored in the Acclaim ASF/AMC format, for which you can write a parser or possibly download a parser. You are also welcome to search for additional BVH files to use on the web. The BVH parser is not perfect -- particularly, it will fail to parse BVH files that have newlines in unexpected places. You are welcome to implement a proper parser using your favorite parser-writing tool for bonus marks.
The BVH file format does not have a defined standard as to which direction is "up" in the world, or what units are used to measure joint offsets and translations. The template code deals with these issues by assuming that "y" is "up", and by normalizing the display scale of the character and its translations by using the longest measured offset, which is roughly equivalent to the longest limb length. This normalization happens with a simple scaling before display.