Inverse Kinematics (IK)

Inverse kinematics (IK) is a method of animating that reverses the direction of the chain manipulation. Rather than work from the root of the tree, it works from the leaves.

Using IK to animate a leg

Let's take the example of an arm. To animate an arm using forward kinematics, you rotate the upper arm away from the shoulder, then rotate the forearm, the hand from the wrist and so, on adding rotation keys for each child object.

To animate the arm using inverse kinematics, you move a goal that positions the wrist. The upper and lower arms are rotated by the IK solution which moves the pivot point of the wrist, called an end effector, toward the goal.

In the case of a leg, for example, the foot is constrained to the floor by the goal. If you move the pelvis, the foot stays put since the goal has not moved, and this causes the knees to bend. The entire animation is contained in keyframes for the goal and the root, without keys being applied to the individual chain objects.

With inverse kinematics you can quickly set up and animate complex motions. The basic procedure involves these tasks:

• Build a model. It could be a jointed structure or many pieces or a single continuous surface.
• Link the jointed model together and defining pivot points, as described in Hierarchies.

For a continuous-surface model, create a Bones structure or use a biped to animate the skin of the character.

• Apply IK solvers to the jointed hierarchy. You will probably create several IK chains throughout the hierarchy, rather than just one. You might also create several independent hierarchies, rather than link everything together in one large hierarchy. For simple inverse kinematic animation you can use interactive IK, without applying any IK Solver.
• Define joint behavior at the pivot points, setting limits or preferred angles, depending on the type of IK solvers you are using. Here you can set up sliding joints or rotating joints.

You might also need to move the root of the hierarchy, and you might want to add control objects such as dummies or points at this point.

• Animate the goal (in the case of an IK Limb solver) or the end effector (in the case of the HD Solver). This animates all the components of the IK chain.

You can apply constraints to the goals or control objects or to the root of a chain.

You can externally reference IK chains in your scene. An XRef IK chain behaves the same as a non-XRef chain, except that you cannot retarget its XRef controller once it is in your master scene. For more information, see XRef Objects.

Control Objects to Assist IK

You can link a goal or an end effector to points, splines, or dummy objects that serve as quick controls to translate or rotate the end of the chain. These control objects can be linked together as well, or they can be controlled with constraints. You can also use parameter wiring to build relationships between these control objects.

You can wire control objects to manipulator helpers or to custom attributes, creating an easily accessible interface for your animatable model.

You can add further controls to manipulate the elements in the middle of the chain.

NoteIn the HI Solver, the swivel angle has its own manipulator, which can be animated or linked to another target object.

Differences Between Forward and Inverse Kinematics

Forward kinematics uses a top-down method, where you begin by positioning and rotating parent objects and work down the hierarchy positioning and rotating each child object.

Basic principles of forward kinematics include:

• Hierarchical linking from parent to child.
• Pivot points defining joints between objects.
• Children inheriting the transforms of their parents.

These principles are fairly forgiving. As long as everything is linked together and the pivots are located at joint locations, you can successfully animate the structure.

Inverse kinematics (IK) uses a goal-directed method, where you position a goal object and 3ds Max calculates the position and orientation of the end of the chain. The final position of the hierarchy, after all of the calculations have been solved, is called the IK solution. There are a variety of IK solvers that can be applied to a hierarchy.

Inverse kinematics starts with linking and pivot placement as its foundation and then adds the following principles:

• Joints can be limited with specific positional and rotational properties.
• Position and orientation of parent objects are determined by the position and orientation of child objects.

Because of these additions, IK requires greater thought about how you link your objects and place pivots. Where many different solutions for linking objects may be suitable for forward kinematics, there are usually just a few good solutions for any given IK approach.

Inverse kinematics is often easier to use than forward kinematics, and you can quickly create complex motions. If you need to edit those motions later, it can be simpler to revise the animation if you are using IK. It also is the best way to simulate weight in an animation.