Skip to content

Instantly share code, notes, and snippets.

@walkoncross
Created August 4, 2021 21:02
Show Gist options
  • Save walkoncross/bad6abb2902d58e88d012032b98ec18d to your computer and use it in GitHub Desktop.
Save walkoncross/bad6abb2902d58e88d012032b98ec18d to your computer and use it in GitHub Desktop.
Bvh文件里的旋转顺序(rotation order)用的是intrinsic rotation
Bvh文件里的旋转顺序(rotation order)
Bvh内的旋转用的是intrinsic rotation,举例:
Bvh文件里面的旋转顺序如果是“Zrotation Xrotation Yrotation”,说明是先绕Z转,然后绕“一次旋转后“、“新的”X轴转,然后绕“两次旋转后“、“新的”Y轴转。因为intrinsic rotation跟extrinsic rotation有“逆序等价”的关系,并且extrinsic rotation三次旋转的旋转矩阵可以直接连乘,所以整体的旋转:
v_rot = M_whole * v_ori
M_whole = M_z * M_x * M_y * v_ori
从以下两个bvh的介绍文档里面可以推理出上述结论:
1. Biovision BVH
https://research.cs.wisc.edu/graphics/Courses/cs-838-1999/Jeff/BVH.html
You can see that the order of the rotation channels appears a bit odd, it goes Z rotation, followed by the X rotation and finally the Y rotation. This is not a mistake, the BVH format uses a somewhat unusual rotation order. Place the data elements into your data structure in this order.
A straightforward way to create the rotation matrix is to create 3 separate rotation matrices, one for each axis of rotation. Then concatenate the matrices from left to right Y, X and Z.
vR = vYXZ
2. Motion Capture File Formats Explained
http://www.dcs.shef.ac.uk/intranet/research/public/resmes/CS0111.pdf
3. blender的import_bvh.py文件里
https://github.com/blender/blender-addons/blob/master/io_anim_bvh/import_bvh.py
这里对旋转顺序做了一个倒序,blender bpy.mathutils.Euler用的都是extrinsic rotation,倒序说明从bvh里面读取的角度是当做intrinsic rotation来处理的。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment