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
For this assignment, you must write a C or C++ program that will read a bvh file that contains motion capture data and output the endpoints of the bones in the kinematic hierarchy.
You can run my program here:
~adamb/public/ForwardKinematics/forwardKinematics input.bvh output.bones
The input file is Biovision Hierarchical (BVH) data format. To free you from having to write a parser, I have pushed skeleton code to you git repository that parses the file format. However, this code does not build a hierarchical data structure. So, you will still have to understand the format well enough to develop a reasonable data structure. The parser is based on code by Masaki Oshita. However, you should not look at that code, doing so may spoil the programming exercise.
The output format is
nframes nbones [x, y, z] [x, y, z]there are nframes*nbones pairs of points. Each line gives the enpoints of one of the bones. The first line gives the enpoints of the first bone in the first frame, the second line the position of the second bone in the first frames, etc.
I encourage you to design your own data structure, but I created a vector of joints, where each one stored its parent, children, channels, and offset. The channels were stored as
std::vector < std::pair < ChannelEnum, int> >so that I knew what the channel represented and so that I could look it up in the frame array. I just stored the frames as
std::vector < std::vector < double> >where the outer vector was frames and the inner vector was doubles. 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.
Plenty more bvh data is available here. But, beware that there are some ^M terminated lines that may mess with the parser, so you might need to preprocess them.
Turn in this assignment electronically by pushing your source code to your class git repository by 1:00 AM 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 by the friday before the deadline.