Rigid-Body Dynamics


Body dynamics are used to simulate the effect of forces and collisions on actual geometry. Maya contains two kinds of body dynamics: soft and rigid. Rigid bodies don't flex or bend, unlike soft bodies, which are elastic and pliable. By using Maya's rigid-body dynamics, you can simulate what occurs when one or more hard objects collide.

Imagine trying to animate a bowling ball crashing into 10 pins at the end of the alleyit would take a lot of time and talent to make that action appear realistic. Maya solves this problem by letting you define objects that you want to interact with (or hit) each other; Maya can then simulate what happens when they make contact (Figure 18.48).

Figure 18.48. A rendering from a rigid-body simulation. The ball collides with the pins, which in turn collide with the back wall, the floor, and each other.


You can create active rigid bodies, which react to collisions and fields (Gravity, Air, and so on), or you can create passive rigid bodies, which are unaffected by collisions or fields. You use passive rigid bodies for things like floors and wallsbasically, any unmovable object that an active body will collide with.

To create a rigid-body simulation:

1.

Create a NURBS sphere.

2.

Translate the sphere in the positive y direction.

3.

Create a NURBS plane, and scale it up to create the floor. Rotate it -5 degrees on the z axis (Figure 18.49).

Figure 18.49. A plane is used as a rigid surface for the ball to bounce off.


4.

Select the sphere.

5.

From the Soft/Rigid Bodies menu, select Create Active Rigid Body (Figure 18.50).

Figure 18.50. From the Soft/Rigid Bodies menu, select Create Active Rigid Body.


6.

Select the plane.

7.

From the Soft/Rigid Bodies menu, select Create Passive Rigid Body.

8.

Select the sphere.

9.

Choose Fields > Gravity.

This attaches a Gravity field to the sphere to make it fall to the ground.

10.

Play back the animation to see the result (Figure 18.51).

Figure 18.51. The more severe the rotation of the plane, the faster the sphere bounces off it.


Bodies have additional properties for specifying simulated behavior. By changing these properties, you can make the geometry behave more like the objects it's supposed to represent. For example, you can assign a large mass to your bowling ball so that it doesn't merely bounce off the pins but rather plows through them.

To assign properties to a body:

1.

Start with the scene from the previous task.

2.

Select the sphere, and choose Fields > Air.

3.

Set the Air field's magnitude to 20 and the direction to -1,0,0 (Figure 18.52).

Figure 18.52. The Air field will create a strong wind in the -x direction.


4.

Press to see the effects of the field.

The sphere is blown right back off the slope because it's very light, like a beach ball (Figure 18.53).

Figure 18.53. The wind blows the light sphere clear off the plane, despite the slope.


5.

Select the sphere, and press to open the Attribute Editor.

6.

In the rigidBody2 tab, set the Mass to 30 and the Bounciness to .2 (Figure 18.54).

Figure 18.54. Set the ball to be heavy and less bouncy, like a bowling ball.


7.

Press to see the effects of the changes.

The Sphere bounces minimally and continues rolling (Figure 18.55).

Figure 18.55. The heavy ball takes more energy to move, so the wind affects it less.





Maya 7 for Windows and Macintosh(c) Visual Quickstart Guide
Maya 7 for Windows & Macintosh
ISBN: 0321348990
EAN: 2147483647
Year: 2006
Pages: 185

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net