If you’re confused by prismatic joints, don’t worry. They are not used that often in Inverse Kinematics, and as you might be able to tell, no humans have prismatic joints — only revolute joints.

Hierarchical Structure

An articulated body has a root joint. The root joint is the base of the structure. The root joint for a humanoid is usually the center of the hips. The articulated body is formed from a tree of joints and links, starting at the root joint. A new joint and link is similar to a new branch on a tree. An inboard link/joint is a link/joint that is closer to the root joint within the tree hierarchy of the articulated body, as it relates to given joint/link. An outboard link/joint is a link/joint that is further away from the root joint within the tree hierarchy of the articulated body. In Figure 4, Joint A is the root joint, Link 1 is Joint B’s inboard link, Link 2 is Joint B’s outboard link.

End Effector

An end effector is a position at the most outboard position of the most outboard link. It is the free end of the chain of alternating joints and links. The end effector is not a joint. The end effector is merely the position at the end of an articulated body. An articulated body can have multiple end effectors, just like a binary tree can have multiple leaves.

Figure 4: The end effector is represented by a green circle.

Articulations and Poses

An articulation is a rotation/translation of a joint which moves a connected link. For example, in Figure 5, Joint A has an articulation of 45°, Joint B has an articulation of 15°, and Joint C has an articulation of -60°. On the other hand, a pose is a set of joint articulations which results in positioning the articulated body. In other words, the pose is a vector value of instead of a scalar value. For example, in Figure 4, the pose of the articulated body is <45°, 15°, -60°>.

Figure 5: Articulated Body with A as the root joint

What is Forward Kinematics?

Before we can get into what Inverse Kinematics is, we need to figure out what Forward Kinematics is. The Forward Kinematics function/algorithm takes a pose as the input, and calculates the position of the end effector as the output. Forward Kinematics is the inverse function of Inverse Kinematics. With Forward Kinematics, you need to define the whole pose of an articulated body so as to provide the function/algorithm with the pose input. This means you need to define the articulation of each joint in the articulated body. This might be fine if you have a low number of joints, but with a high number of joints this tends to be tedious.

What is Inverse Kinematics?

Now, imagine if you’d like the end effector of your articulated body to reach a particular target position. This means that you know the end effector position you’d like to target, but you don’t know what the pose of the articulated body needs to be for the end effector to reach this target position. This is where Inverse Kinematics shines!

Figure 6: The target position is represented by a red circle. The target position is defined as the input, and the resulting pose required for the end effector to reach the target position is the output.

Inverse Kinematics is the inverse function/algorithm of Forward Kinematics. The Inverse Kinematics function/algorithm takes a target position as the input, and calculates the pose required for the end effector to reach the target position — the pose is the output.

As you can see, the input and output are switched between FK and IK. With Inverse Kinematics, you do not need to define the whole pose of an articulated body — this gets calculated for your by the IK algorithm. With IK, you only need to define a position as the input.

Inverse Kinematics does all the challenging computational work of calculating what the pose is. Figure 6 represents this well. In the Before Scene, there is an articulated body with some known pose. It defines a target position for the end effector to try to reach. Once the IK algorithm is applied to the articulated body, we have reached the After Scene. The After Scene shows that a new pose has been computed, such that the end effector is now at the target position.

What are the uses of IK?

At this point, we know that IK is applied to an articulated body, we know what an articulated body is made up of, and we know the difference between IK and FK. We have a good overview of IK so far, but let’s round it out with some good use cases of IK as well. IK can be used for a humanoid arm to reach for an object/target, as we’ve seen. IK can also be used for foot stepping, such that we tell the foot where to step and the IK figures out how to configure the leg joints. IK is not usually used as an animation itself (reaching for an object), but more as an animation tool. So, if you are implementing a walk cycle, you could position some of the key frames using the IK tool.

Figure 7: IK is applied with foot rotation as the goal. Joints L & R rotate to conform to the inclined plane.

Another key point about IK is that your goal/target is not limited to position alone — your goal can be defined as a rotation. For example, if your feet need to rotate based on uneven terrain, your IK rotation goal can be defined based on the floor’s normal. See Figure 7. This way your feet are inclined along the floor, such as when you are walking up an incline. Note that you can also use IK to have your head (or even eyes) look in a certain direction. If you want your head to follow an object, you can use IK to have the head follow the object around.

IK Demo

I’ll leave you with an IK demo to finish the article. This character moves his left hand and right leg with moving IK targets.

IK Demo in Unity3D

Looking for an implementation? This is The Simplest IK Algorithm.