Forward Kinematics and Inverse Kinematics


Before we work on creating controls for animating Kila and Grae, it's important to understand a major principle of character rigging: forward kinematics (FK) and inverse kinematics (IK). FK and IK are two different methods of moving a character in a scene. Each has its advantages and disadvantages, depending on what you want the character to do, and so both should be implemented into the character rig to account for any eventuality.

Forward kinematics is the process of animating down the hierarchy. For example, to raise or lower a character's hand you would rotate the shoulder, then the elbow, and finally the wrist (Figure 12.6).

Figure 12.6. Example of forward kinematics (FK)


Animating with FK is highly recommended because in many cases it produces better, more natural looking movementsbut it's not always practical. Say the character is leaning with a hand on a table; we would need the hand to stay locked while the character's upper body moves. Keeping the hand steady using FK would be practically impossible, but with inverse kinematics it's a piece of cake.

Inverse kinematics works opposite to FK. As suggested by its name, in IK the joint chain is evaluated backward. Figure 12.7, left, shows the hand on the table with an IK handle applied (the cross located at the wrist). The IK handle dictates the position of the wrist, locking it in place. The rest of the arm then follows. If we move the main joints of the body forward (Figure 12.7, right), you can see that the wrist stays where it is. The hand remains locked, resting on the table, because the IK handle is not parented to (controlled by) any joints in the skeleton. The shoulder and elbow joint rotations are calculated by the IK solver (explained shortly) to allow for the best possible position and orientation of the skeleton chain between the shoulder and the wrist.

Figure 12.7. Example of inverse kinematics (IK)


IK Solvers

IK solvers are the brains behind IK handles. They work out how to rotate each joint in a joint chain controlled by an IK handle. There are three types of IK solvers in Maya: IK Single Chain solver, IK Rotate Plane solver, and IK Spline solver.

The IK Single Chain solver is the most fundamental way of manipulating a joint chain. Not only do you use the IK handle to manipulate the joints' position, you can also use its rotation to adjust the joint chain's orientation.

Figure 12.8, left, shows an arm with an IK Single Chain solver applied. Rotating the IK handle around the X axis will adjust the direction in which the elbow points (Figure 12.8, right).

Figure 12.8. An arm with an IK Single Chain solver applied


On initial creation, the IK Rotate Plane solver looks the same as the Single Chain solver, except that you cannot alter the orientation of the joint chain by rotating the IK handle. Instead, the pole vector and handle vector (Figure 12.9) define the plane on which the middle joints lie. Imagine that the two vectors make up two edges of a flat triangle, with the arm joints lying on this triangle. Since the pivots for this triangle lie on the shoulder and wrist joints, moving the end of the pole vector will tip the triangle, forcing the joints to follow and affecting the orientation of the arm.

Figure 12.9. The pole vector and handle vector on an IK Rotate Plane solver


You can move the pole vector by selecting the IK handle and pressing T to activate the manipulator tool. This will select the pole vector, allowing you to manipulate it. This can be very useful when animating arms or legs, because you can lock the pole vector to an object behind the arm using a pole vector constraint, meaning the elbow will point exactly where you need it to point. We will discuss the various constraints later in the chapter.

NOTE

Another way to manipulate the arm's orientation is to use the Twist attribute on the IK handle, although in this arrangement it can be difficult to keep the elbow steady when the arm has a lot of movement.


The IK Single Chain and Rotate Plane solvers are created in exactly the same way. Go to Skeleton > IK Handle Tool and open up the options. Following are some of the options associated with this tool (Figure 12.10).

  • The Current Solver box specifies which of these two IK solvers you wish to create. You can change this after the handle has been created, allowing you to switch later if you need to.

  • Solver Enable specifies whether the IK solver will be enabled upon creation.

  • Snap Enable allows the IK handle to snap back to its origin (the second joint you selected in the handle's creation).

  • Sticky allows the IK handle to stick to its current position while you continue to pose the skeleton.

Figure 12.10. IK Handle tool options


An IK Spline solver is a spline-based system best suited to long joint chains, like the kind you would see in a snake, a tail, tentacles, or even a spine. Once you create this solver, Maya gives you a spline with which you control the movement of the joints.

As you can see in Figure 12.11, manipulating the CVs on the spline will affect the rotations of the joints.

Figure 12.11. Example of IK Spline solver


How can we apply these IK solvers to our characters Kila and Grae? The most obvious places are the characters' arms and legs, enabling the feet to lock to the ground as they walk, and the hands to be locked to specific objects. We could use the IK Spline handle on the spines, but Kila and Grae's spines are made from just a few joints, so it would not benefit the animator in the long run. Using the IK Spline would take longer to animate; in addition, it could lead to restriction of the spine's movement since you would not be able to animate each joint separately.

On top of the IK, we will also need to add controls that will make it easier to use. All this can become fairly complex, so with this in mind let's start building the controls that will animate our base skeletons. We'll begin with the characters' arms and hands.



    Game Character Development with Maya
    Game Character Development with Maya
    ISBN: 073571438X
    EAN: 2147483647
    Year: 2004
    Pages: 169
    Authors: Antony Ward

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net