Using Dual Quaternions for Skinning
July 11, 2022About 1 min
Using Dual Quaternions for Skinning
之前实现的蒙皮混合插值叫作线性插值,这种线性插值在有体积旋转是会出现一定的问题。如下图 :

为了解决这个问题,我们可以使用对偶四元数来做混合。
Introducing dual quaternions
对偶数跟虚数很像,对偶数由一个实数部分和对偶部分组成。假设ε是对偶操作符,一个对偶数可以表示为:
它可以代表这两个四元数或者8方位的浮点数
具体的可以参看资料:https://cs.gmu.edu/~jmlien/teaching/cs451/uploads/Main/dual-quaternion.pdf
Implementing dual quaternions
点乘结果属性:
- 如果为正数,对偶四元数点在相同方向
- 如果为负数 ,对偶四元数点在反方向
- 如果 为0,对偶四元数垂直
Skinning with dual quaternions
我们需要使用对偶四元数替换蒙皮中的矩阵。
三个步骤需要使用对偶四元数替换矩阵:
- Convert the matrices to dual quaternions in the vertex shader
- Convert the matrices of the current pose to dual quaternions, then pass dual quaternions to the vertex shader
- Convert each transform of the current pose to a dual quaternion, then accumulate the world transform as a dual quaternion