# IK - Euler angles or quaternions?

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

## Recommended Posts

I have got skeletal animation working as they should and now planning to enhance these with limb IK solvers (to keep feet on ground etc.)

Quaternions are much nicer for keyframed animations, no question.
But for IK solver Euler angles seem to be much more natural:

• They allow me specify constraints easily (as maximum/minimum rotation angles). Converting constraints to quaternion space seems quite clumsy...
• Joints with only 1 DOF (knees, elbows) have only 1 adjustable component in Euler angle based rotation, but 3(4) in quaternion, meaning that solver will probably be slower and noisier.
Am I overlooking something? How are IK solvers and constraints normally added to keyframed animation systems?
Or is it pseudoproblem, as (hopefully) most IK adjustments to legs and hands are small enough, so the lack of constraints would not be visible?

Any help would be welcome!

##### Share on other sites

But for IK solver Euler angles seem to be much more natural:

Entirely incorrect. Rotations with quats are more natural than Eulers. Since IK deals with rotations, it also sees benefits for having a more natural representation.

[color=#1C2837][size=2]Converting constraints to quaternion space seems quite clumsy...[/quote]
[color=#1C2837][size=2]Not if the constraints are already in quaternion space.

##### Share on other sites

[color="#1C2837"]Converting constraints to quaternion space seems quite clumsy...

[color="#1C2837"]Not if the constraints are already in quaternion space.
[/quote]
But how do you specify constraints in quaternion space?
It can imagine that it is simple for 1 DOF joints - just restricting quaternion to single XYZ component and giving maximum and minimum values for it. It translates directly to maximum and minimum angles of rotations in given direction.
But 2 or 3 DOF joints? Should simply restricting XYZ components work here too? And does these values have some simple geometric meaning so one can specify them manually during skeleton creation?

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 9
• 11
• 15
• 21
• 26