• Create Account

## Skeletal Animation Using Dual Quaternions

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

2 replies to this topic

### #1Atimlotus  Members

107
Like
0Likes
Like

Posted 17 August 2013 - 10:56 PM

I'm having a small but annoying problem with implementing skeletal animation using Dual Quaternions.  The idea is to do the bone interpolation CPU side and to do the skinning on the GPU using boneID's and Weights.

My current Test Case

2 Bones.  Bone 0 = Parent , Bone 1 = Child

Keyframe 0 (Bind Pose)

Bone 0 : Head at (0.0, 0.0, 0.0) , Tail at (2.0, 0.0, 0.0) (Z is up)

Bone 1 : Head at (2.0, 0.0, 0.0) , Tail at (4.0, 0.0, 0.0)

Keyframe 1

Bone 0 : 90 degree rotation around the Y-Axis (Locally)

Bone 1 : 45 degree rotation around the Y-Axis (Locally)

The idea here is that at the end of the interpolation Bone 1's head, having been rotated by Bone 0, will be at (0.0, 2.0, 0.0) and the tail will have a further 45° rotation putting it at around (-1.414, 3.414, 0.0)

---------------------------

The problem I'm having is that I can't seem to get the Head for Bone 1 to stay connected to the Tail of Bone 0.  I can get each bone to rotate properly, i.e. Bone 1 has the combined 135° degree rotation in the end, but its position isn't right.

Bone 0 = Green ,  Bone 1 = Yellow

Here's my current process :

1.  Start at Parent (Bone 0), Interpolate between Keyframe 0 and 1 using TimeDelta -> Makes New ParentDQ

2.  Send new ParentDQ to Child (Bone 1)

3a. Interpolate Child between Keyframe 0 and 1 using TimeDelta -> Makes new ChildDQ

3b. Multiply new ChildDQ by new ParentDQ -> Adds parent rotation to child bone.

3c. Multiply updated ChildDQ by ChildInverseDQ -> Moves child bone into its position??

ChildInverseDQ is a DualQuat created by negating the bind pose starting position.

ChildInverseDQ = .5 ( t r )

: t = (2.0,0.0,0.0,0.0) , which is the bones head position

= (0.0,0.0,0.0,1.0), identity quat

=  q_real (0.0,0.0,0.0,1.0) <- (x,y,z,w)

q_dual(-1.0,0.0,0.0,0.0) <- (x,y,z,w)

What I'm doing is obviously not working for me, but is the theory sound?  How far off am I?

### #2Steve_Segreto  Members

2007
Like
0Likes
Like

Posted 20 August 2013 - 02:43 PM

Sorry I'm not much for scrutinizing your code atm .... can you compare against this working implementation?

http://www.gamedev.net/topic/575051-dual-quaternion-skinning-vs-linear-based-quaternion-skinning/

### #3Dark Helmet  Members

173
Like
0Likes
Like

Posted 21 August 2013 - 07:46 PM

ChildInverseDQ is a DualQuat created by negating the bind pose starting position.

Doesn't sound right. This should be the full inverse of the bind pose transform for the specified joint (rotation and translation). For the root joint this might just be a negative translation (i.e. 0 deg rotation), but for child joints in general, this is not the case.

What I'm doing is obviously not working for me, but is the theory sound? How far off am I?

Sounds like you're close. If trouble persists, would just do your transform compositing using matrices, and then just do a matToDQ on the tail end. Then later you can flip to DQs.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.