Skip to content

szepi1991/cmput411-assignment3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cmput411-assignment3

This program reads in and displays a model of a human in the wavefront obj format and a skeleton animation in the .bvh format. The skeleton animation may be played back and the model will morph along with it! See the pdf description of the assignment for full features.

(Note that while technically other models can also be loaded, they need to be matched up to the skeleton for the program to work correctly.)

Development was done in eclipse, hence this folder actually can be imported into eclipse as a project rather simply, and then built and run there. (Do not forget to specify which model to load in the command line arguments.)

Alternatively, the code can be compiled and then run with the following commands (THIS DOES NOT WORK YET!):

make
./personviewer <meshfile.obj> <motionfile.bvh>
Assumptions about the project
  1. All the bvh files we load either have "CHANNELS 6 Xposition Yposition Zposition Zrotation Yrotation Xrotation" or "CHANNELS 3 Zrotation Yrotation Xrotation"
  2. Any root is not a leaf (this is valid assumption as that would not make sense)
  3. I do NOT assume that there's only one root in the file, however I never tested whether my parser works with multiple roots or not. In case there are multiple roots, I assume that their animation descriptions are interleaved, as in the first line contains the information about the first frame for all the trees, then the second line describes the second frame for all trees, etc.
  4. For calculating the initial viewing position I make the assumption that only ROOT's have translation transformations.
  5. When outputting the .obj file, I output the normalized normals.
  6. Each face is in the .obj model is a triangle.
  7. While closest bone to vertex should intuitively be:
	argmin_{bone b} ( inf_{line l connecting a point of b to v, not crossing any faces} (length of l) )

This is hard to calculate and so i do

	argmin_{bone b, the line segment l joining closest point of b with v does not cross any faces} ( length of l )

as suggested in the notes.

Attention required
  1. I use Eigen's computeInverseWithCheck() function for testing if a triangle intersects with a line segment. It seems like there's some randomness in there, so already the C matrix changes between runs.
Credits / Libraries not written by me
  1. Boost
  2. Eigen
  3. VoxBits things (used for strong_ptr)

Developed by David Szepesvari. Started November 8, 2012.

About

My assignment 3 for comput 411 at University of Alberta

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages