# Contstraints(quaternions)

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

## 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 on other sites
Not sure specifically. However, i'll point out that [google]: "quaternion constraint" produces a lot of results that look promising.

-me

##### 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 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

1. 1
Rutin
25
2. 2
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 14
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631758
• Total Posts
3002137
×