Below is a program that displays a real-time animation of a stick figure.

The figure is made up of a tree of "bones", each of which represents a rigid rod of fixed length that can change the orientation of its distal end relative to the distal end of its parent. The animation itself consists of a series of "keyframes", each of which indicates the relative orientations of the bones at a single point in time. The program interpolates, or "tweens", the poses described by a pair of adjacent keyframes to determine the actual pose of the skeleton at a particular moment.

You can rotate the camera with the A and D keys.

To see the source code, visit http://thiscouldbebetter.wordpress.com/2014/02/13/posing-and-animating-a-3d-stick-figure-in-javascript/.