I am struggling with how to take the rotation vectors defined in the bvh file format and alter them to rotate the skeleton around an axis ( for all frames ).
This suggests that "the values of the BVH [are] in the order ... for a good reason." Which is supported by blenders import_bvh.py functionality.
Originally, I thought that I could just alter the root rotation. The result was that the facing direction of the armature did rotate around the given axis, but the rotation around one of the axes caused unrealistic motion. Best understood by watching the following:
I then tried changing all of the rotation vectors around ( by simply applying a rotation to the rotation vectors ) which got really messy.
Today, I decided to write out a little repo to alter the bvh files.
You can see here that I am simply applying a rotation to the rotation vectors... I know this is wrong, but I am a little stuck as to what to do. I was thinking that the rotations of a given joint don't need to change in magnitude, just in the axis that they occur.
CodePudding user response:
I ended up rotating the rotation ( euler ) vector and position vector of the root to get what I wanted. To get the correct rotation ( euler ) vector for each frame, I turned the root rotation ( euler ) vector into a rotation matrix, applied a rotation to the matrix then converted it back to rotation ( euler ) vector.
Refer to this to understand what I mean by rotation vector
I'm sorry if my question was confusing. I was pretty confused when I wrote it.