Graphics Programs Reference
In-Depth Information
body that is hit by (collides with) the bat as it swings. The momentum of the bat is trans-
ferred to the ball, and the ball is sent flying into the stadium stands.
You'll see an example of this in action in the next tutorial.
Rigid Body Attributes
To make an object a rigid body, you add several attributes that help govern how it behaves
in a dynamic simulation. Here is a rundown of the more important attributes for both
passive and active rigid bodies as they pertain to collisions:
Mass Sets the relative mass of the rigid body. Set on active or passive rigid bodies, mass is
a factor in how much momentum is transferred from one object to another. A more mas-
sive object pushes a less massive one with less effort and is itself less prone to movement
when hit. Mass is relative, so if all rigid bodies have the same mass value, there is no dif-
ference in the simulation.
Static and Dynamic Friction Sliders Set how much friction the rigid body has while at rest
(static) and while in motion (dynamic). Friction specifies how much the object resists
moving or being moved. A friction of 0 makes the rigid body move freely, as if on ice.
Bounciness Specifies how resilient the body is upon collision. The higher the bounciness
value, the more bounce the object has upon collision.
Damping Creates a drag on the object in dynamic motion so that it slows down over
time. The higher the damping , the more the body's motion diminishes.
Animating with Dynamics: The Pool Table
This exercise will take you through the creation of a scene in which you'll use dynamics
to animate a cue ball striking two balls on a pool table.
Creating the Pool Table and the Balls
You'll create a simple pool table as a collision surface for the pool balls. To create the
table, follow these steps:
1. Create a polygonal plane for the surface of the table. Scale it to 10 along its height and
length.
2. To create the pocket holes, make two holes in opposite corners. The easiest way is
to duplicate the tabletop plane and offset it slightly in both directions, as shown in
Figure 12.3. Doing so creates a pair of square holes in the corners for the ball to drop
through. For this exercise, it will do perfectly well.
3. Create a polygonal cube, and scale it to fit one edge of the plane to create a rail.
Duplicate the cube three times, and then move and rotate the pieces to create the
rails around the table, as shown in Figure 12.4.
Search WWH ::




Custom Search