Animation is a very delicate matter, when it comes to a 3d application. How should I do it? Which way will give me the most power without sacrificing speed? Which format will take the least amount of space? Should I use my own format? The list goes on and on! In the early 21st century, more people are turning to skeletal animation for games than anything else.
Why is skeletal animation so special? Better yet, what exactly is skeletal animation? Simply put, it is a form of animation that uses a complex system of bones and joints (a skeleton) to deform the model information. Take a look at this illustration.
If you made it past the second grade, you immediately recognized this as a triangle. A triangle has 3 points, A, B, and C. Let's say we wanted to make point A go down some, and points B and C, to go out, making it look like it was squashed. Let's also say that we want the entire triangle to spin at the same time. How do we do that? Well, we could calculate and store the coordinates of each point each frame, and then just set our points to that every frame, but that is slow, static, and clunky. Even then you are going to have to calculate rotations, and that could be difficult.
Let's put some anatomy into the equation. If this were an animal, say the rare Triangularus Sting-rayus, it would probably have 4 joints and 3 bones.
Our Triangular Ray just gained bones B1, B2 and B3, and joints J1, J2, J3 and J4 (a joint is represented as an arrow or circle, and the bones as a line). Now if you notice, all of the bones B1-B3, and their end joints, J2-J4, spawn off of J1, or the Base Joint. What this essentially means is that when J1 moves, all of the children bones and their end joints will move. So if J1 moves up some, everyone moves up some.
In a similar sense, if a child joint moves, and it has no children, only it will move. So lets say we move J4 up some, J1-J3 would be unaffected. Understand? Good! Now, Each bone (usually) has vertices (points) attached to them, so that when they move, those vertices move too! In this example, J2 would have B attached to it, J3 would have C attached to it, and J4 would have A attached to it. So if J4 moved up, A would move up equally. If J2 moved left, B would move left equally. If J1 moved down, A-C and our joints would all move down equally! The beauty of this system is revealed!
This is all achieved by a complex system of matrices, frames & keyframes, and animations. Each joint is, in a way, its own little matrix.
Every vertex attached to a joint is transformed by that matrix, and saved into a temporary, deformed version of the model, and then displayed. Very effective, very fast, very powerful!