I WHY USE DYNAMICS FOR CHARACTER ANIMATION? Situations in which this technique is most viable is with actions that are nonacting driven. Most common are where the performance is derived from external forces affecting the character and where broad motion is needed. These situations are sometime difficult to keyframe but when driven by physics can be completed convincingly and quickly. This methodology is ONLY intended as an addendum to existing animation tools and rigs. II BIO-DYNAMICS In investigating motion dynamics of animals we have found that their anatomy is designed to perform movements that are within a range of motion. That motion is executed on axes of rotation. How many axes of rotation a particular movement needs can be described in two major categories/joint types – Hinges and Ball Joints. The most limited range of movement occurs on only one axis – this describes the functionality of a Hinge joint. The knee for example operates around a pivot with a given axis of rotation running through it. The Ball Joint allows for movement across three axes of rotation and usually places limits on one or more axis in varying amounts. For example, your shoulder and your wrist can be considered ball joint connections in that you have three degrees of freedom in movement. However, the range of movement between the two is different. There is less freedom in the wrist. If we replicate this behavior between rigid bodies we can create a system of movement. Depending on how we arrange this system we can create dependencies that operate according to anatomical principles. Maya provides three dynamic constraints that combined together provide the necessary elements for creating our joint types. PINS A Pin constraint links two rigid bodies at a specified position. It works as if the two objects are connected by a metal pin with a ball joint between its ends. HINGES A Hinge constraint constrains rigid bodies along a specified axis. SPRINGS A Spring constraint simulates an elastic cord that has a stiffness and a damping ability to it. The purpose of the dynamics rig is to connect rigid bodies using a combination of the constraint types listed above. When the dynamic constraints are put together into a structure a parent/child dependency is created between rigid body segments. This creates a forward kinematic relationship between the rigid bodies so that when simulated, they reflect forward kinematic movement (i.e. the parent’s movement affects the child’s location) including the proper limitations in range of movement. The limitations will be indicative of the structure of the constraint system, which will either reflect a hinge or a ball joint. The pin and hinge constraints provide the range of movement but also as the pivot for movement. So, we can accurately place these constraints at the true pivot locations of real bones. These two constraints provide the difference types of motion (single axis or multi-axis). It should be noted that parenting dynamic constraints and rigid bodies may cause instability in the solver. The general rules are that pins cannot be parented while hinges and springs can. There is an inherent problem in 3D in that the hinges and pins provide for a very large range of motion. This range needs to be reduced by a counter force applied to the rigid bodies. This counter force replicates the natural limitations provided by real tendons and muscles. The spring constraint will be our counter force. Another problem arises in 3D in that springs are created between the centers of mass of rigid bodies. In this scenario there is no existing countering force to another rigid constraint running between the centers of mass. To counteract or limit a range of movement we need some leverage. A spring cannot provide torque against movement without being leveraged some distance away from the centers of mass. So for either a Hinge joint or a Ball Joint, our hinge and pin constraints will run between the centers of mass of the rigid bodies and our spring constraints will be offset. The mathematical reasoning behind offsetting the spring constraints is further illustrated below. Figure 2.1 – Explanation of offset spring Torque, the force that makes objects spin can be represented with a vector. To find the vector torque T we calculate the cross product of the force applied to the rigid bodies, in this simple case g, the gravity, and the vector r running from the hinge to the center of mass of the rigid body. If this is the only force on the system (g) the torque (T) causes the rigid bodies to spin around the hinge. To counter balance that force and be able to control the system we need another torque force T2 applied in the opposite direction. To create T2 we use the force of a spring (F) offset by a distance (b). The longer the vector b is, the longer and stronger the T2 vector is going to be and vice versa. This is why we cannot have the spring directly through the center of mass of the two rigid bodies. The vector b would be 0, the cross product would also be 0 and consequently the torque T2 would be 0 causing no amount of opposing force. In order to offset the spring location (our explanation of the counter force above) we must create other rigid bodies to host the spring constraint. The spring must be “connected” to the rigid bodies as well. For our spring holders we will use two cubes turned into rigid bodies with the spring between them. For each connection/joint between rigid bodies we must decide which body will act like a parent and which like a child. As mentioned above the goal is to create a forward kinematic dependency. This is accomplished by how the “spring cubes” are setup. By turning one spring cube active and the other passive the force of the spring will affect the active spring cube. If the inactive spring cube can “inherit” its transforms from the object we want to be the rigid “parent”, the transforms of the rigid “parent” will ultimately drive the location of the active spring cube. If the passive spring cube is parented underneath the rigid parent its position will not update properly when the animation rig drives the position of the rigid bodies. To bypass this problem we point constrain the passive cube to a locator that is a child of the rigid parent. As the parent moves, the inactive spring cube follows causing the spring to change length driving the placement of the active cube. The active spring cube is “attached” via hinge constraints (the rotation torque hinges in Figure 2.2) to the rigid “child” helping to drive its transformations. Two hinges at 90 degrees of one another produces two forces that cancel each other out thus creating a dynamic parent relationship. This is how the force of the spring is transferred to the rigid child. So, the combination of the hinge or pin constraint (providing a pivot and range of motion) and the leveraged/offset spring (torque) help dictate the parent/child relationship between the rigid bodies. The existence of the spring cubes is only for offsetting our spring counter force. They should not contribute in any way to the simulation except providing a counter force and helping drive the transformations of the rigid child. Therefore, they should not have any relevant mass, friction, damping, bounciness or collsion. The script that generates them takes care of setting those attributes for you. Anatomy of a Hinge Joint Below is the layout of a Hinge Joint. There is a hinge constraint created between the two rigid bodies and a single offset spring. Figure 2.2 – The Hinge Joint Layout Anatomy of a Ball Joint Figure 2.3 represents the layout of a Ball Joint. There are two offset springs and a pin connecting the two rigid bodies. Figure 2.3 – Ball Joint Layout It is important to not that the further away you place the offset springs the more leverage you create between the spring and the hinge/pin constraint. The torque will be provided to help offset or counter the amount of rotation the hinge/pin wants to do between the rigid bodies helping to stabilize the system. In addition, for Ball Joints another method of stabilization is to create two Ball Joint systems for one connection between rigid bodies. For example, between the hips and the waist and the waist and the chest it is wise to put two Ball Joints at each position. When the character bends or leans in any direction there is a spring helping to balance the amount of movement. This dual Ball Joint configuration also helps in that the placement of the spring cubes can be much closer to the rigid bodies instead of further away if only on Ball Joint existed. This can help in visually deciphering what is occurring in the rig. |
|