The figure is a collection of links which are hierarchically attached to each other. The pelvis link is the root of the figure's hierarchy. Each link contains a set of child links and a reference back to its own parent link. Operations such as drawing, selecting and forward kinematic calculation traverse the hierarchy inorder.
For example, when the user clicks in the window, a selection traversal of the figure is initiated. As each link is drawn, its identifier is pushed onto a stack of "names". When the name stack is later interrogated, a link's identifier is produced as the link that was under the cursor when the mouse was clicked. This identifier is then fed into the root link's select method. The select method traverses each link's children until the identifier is matched, the selected link is then redrawn in the color which indicates selection.
![]() | ![]() |
Figure 2 The selected hand link is highlighted red. The rest of the links in the chain are highlighted blue.
Figure 3 the forearm is selected. The hand turns pink, indicating that it is a child of the selected link.
As a link is selected, the figure object attempts to make an inverse kinematic chain with the selected link as the end effector. The links themselves handle all selection related highlighting and drawing. Even a single link can be considered a chain which is composed of one link, the end effector. Chains with more than one link can be animated via the pseudoinverse kinematics algorithm described below.
Table of Contents | < Architecture: How It does It | The Underlying Algorithm > |