Game Development Reference
In-Depth Information
Aligning feet with ground - inverse
kinematics
Inverse kinematics is now a common part of animation systems in games and is a topic that
might cover a chapter on its own. In this recipe, we'll look at placing a character's feet in
accordance to the ground below. This is useful where an animation would otherwise place
them in the air or on sloped ground.
Normally, animations work according to forward kinematics; that is, when a bone near the
root of the skeleton rotates, it affects the bones further down the chain. As the name im-
plies, Inverse Kinematics starts at the other end.
Here, we strive toward a desired position for the tip of a chain of bones, and bones further
up the chain try to align themselves to suit this.
The most straightforward implementation of this rotates the bones by a small amount on all
the axes. It then checks which of the rotations brings the tip closest to the desired position.
This is repeated for all the bones in the chain and iterated until it has come close enough.
Search WWH ::




Custom Search