GClements, thank you very much for your explanation.
However, my choice went for Quaternion Translation. I find myself is harder to understand Dual Quaternion, so I decided to rewrite my previous animation code to shader.
Here’s pseudo of my code using.
// Load bones
Build joint localSkeleton matrix
Set joint translation to localSkeleton matrix
Copy localSkeleton matrix to globalSkeleton matrix
Multiply globalSkeleton parent matrix with globalSkeleton child matrix
Copy globalSkeleton to global matrix and local matrix
Find two angle rotations and two joint position
Set two quaternions of the angle rotation
Do the quaternion SLERP
Convert the quaternion to quaternionMatrix
Set joint translation from joint position to quaternionMatrix
Multiply localSkeleton matrix with quaternionMatrix and store it in local matrix
Copy local matrix to global matrix
Multiply global parent matrix with global child matrix
Convert matrix to quaternion translation (matrix2x4)
Send the quaternion translation to the shader
My joints model has 3 axis angle and 3 position, and the rotation and translation are stored in globalSkeleton, global, localSkeleton, and local matrix (they all 4x4).
I got problem with transforming the vertex, in my previous code the way I transform the vertex is by multiplying it with global matrix.
I’m not really good in math, try to search around the web does not give me the answer.
If you look at the code, when transforming the vertex, I have to multiply the original vertex with globalSkeleton matrix, and after I got the result I multiply it again with global matrix then I can get the vertex I want.
Problem is, I just convert the global matrix to quaternion translation, later in the shader I need globalSkeleton matrix to transform the vertex. If I have to convert the globalSkeleton matrix to quaternion too, there’s no difference with uploading a final matrix.
My point is how to get the final matrix, convert it to quaternion-translation, send it to shader, convert to matrix in shader, and then transform the vertex.
Is there any wrong or missing step I did?
Thank you very much.