• Advertisement
Sign in to follow this  

Contstraints(quaternions)

This topic is 4204 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
Not sure specifically. However, i'll point out that [google]: "quaternion constraint" produces a lot of results that look promising.

-me

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement