Hey All,
I’m implementing a skinning algorithm using dual quaternions to represent the translation/rotation of my joints a la wscg.zcu.cz/wscg2012/short/A29-full.pdf. However, I’m getting some errors during interpolation, and I suspect it’s due to the fact that my quaternions aren’t being normalized.
Here’s the deal: I understand how to use quaternions to represent rotation, and I understand why slerp works in this case. In order for us to use slerp we need a unit quaternion, and the rotation quaternion is unit (unit vector for axis, sin2+cos2 = 1).
However, I don’t believe that you can use slerp for the translation component (aka dual part) because it is not a unit quaternion on its own. We could normalize them, but if we did then we’d be losing the original translation information we wanted to store. We could store the translation magnitude, normalize the translation quaternion, and multiply it back in after slerp finishes, but then we’d have to linearly interpolate the magnitude, hence defeating the purpose of slerp.
As of now, using glm, I’ve got the following slerp function:
using namespace glm; //not really but you get the idea
fdualquat dualSlerp(fdualquat a, fdualquat b, float x){
fdualquat ret;
ret.real = slerp(a.real,b.real,x);
ret.dual = lerp(a.dual,b.dual,x);
return normalize(ret);
}
However, this feels dirty; there’s no way I can combine slerp and lerp in the same function. However, I can’t slerp the dual part because it’s magnitude is greater than 1,
To be honest, I don’t see the point of dual quaternions at all if this is the case. Since we’ve got 8 floats in a dual quaternion, why not use one quaternion for rotation and one vec4 for translation? We could even use a vec3, but the one number isn’t the issue here. Why are dual quaternions used at all?