Contstraints(quaternions)

Started by
2 comments, last by Dirk Gregorius 17 years, 8 months ago
So, i have IK implementation in my application, to restrict rotation of the bones of my character i must convert quaternion to Euler angles ang then from Eluer angles again in quaternion. Is their another approaches to implement quaternion constraints without converting to Euler angles?
Advertisement
Not sure specifically. However, i'll point out that [google]: "quaternion constraint" produces a lot of results that look promising.

-me
I'd like to know the answer to this.
My initial idea would be to use a plane as a constraint - and don't allow rotations if a point gets translated 'into' it, a bit like collision checking.
You could transform the quaternion into a matrix and then you could for example constraint that two axis should be perpendicular and this way prevent rotation around the third axis:

Example:
Assume you have two quaternions q1 and q2. You find two associated frames u1, v1, w1 and u2, v2, w2. You now can prevent the rotation around w by formulating:

C = u1 * v2 = 0

You find the Jacobian by building dC/dt (where omega1 and omega2 are the related angular velocities) which will yield:

dC/dt = du1/dt * v2 + u1 * dv2/dt = (omega1 x u1) * v2 + u1 * (omega2 x v2) = (u1 x v2)*omega1 - (u1 x v2)*omega2 = J * v

Therefore: J = ( 0 (u1 x v2) 0 -(u1 x v2) )

The same way you can put limits on the axes of course...

HTH,
-Dirk

This topic is closed to new replies.

Advertisement