Sign in to follow this  
CAHI4

Contstraints(quaternions)

Recommended Posts

CAHI4    122
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
Palidine    1315
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
stevenmarky    369
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
DonDickieD    2751
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this