Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
3ds Max 6 Bible (2004).pdf
Скачиваний:
55
Добавлен:
17.08.2013
Размер:
50.02 Mб
Скачать

954 Part IX Dynamics

Figure 39-11: You can use the Flex modifier to simulate the motion of soft body objects like cloth.

Summary

This chapter covered the basics of animating a dynamic simulation using the Dynamics utility. In this chapter, you

Created and used Spring and Damper dynamic objects

Defined dynamic material properties for different objects using the Material Editor

Used Space Warps to add forces to dynamic simulations

Learned how to use the Dynamics utility to set up dynamic simulations

Optimized simulation keys using the Track View Reduce Keys button

Learned about the Flex modifier

Using the Dynamics utility works, but for the latest dynamic simulations, the reactor features are definitely the way to go. The next chapter covers them.

 

 

 

Animating with reactor

When you speak of reactor in Max, you really are speaking of physics. Physics is one of the coolest arms of science because

it deals with the science of matter and energy and includes laws that govern the motions and interactions between objects. For animators, this is great news because what you are trying to do is to animate the motions and interactions between objects.

So, should all animators study physics? The answer is absolutely. Understanding these laws through study of experience will sharpen your animating skills. But you can also take advantage of the work that other animators have done in understanding the laws of physics and turning them into a product that ships with Max. The other animators are a group called Havok, and the product is reactor.

Using reactor, you can simulate many physical properties and automatically capture keyframes as the objects interact. It’s like getting a physics degree for free.

Using reactor

The reactor plug-in was developed by a company named Havok. reactor is a complex piece of software with a huge assortment of features that enable you to define physical properties and forces and have the scene automatically generate the resulting animation keys as the objects interact while following the laws of physics.

Note

Be aware that the reactor plug-in is different from the Reactor con-

 

troller, discussed in Chapter 31, “Animating with Constraints and

 

Controllers.”

The reactor plug-in interface exists in the Utilities panel and is one of the default utilities, but you can also access it from the reactor menu and the reactor toolbar, shown in Figure 40-1. The reactor menu and the reactor toolbar provide a quick and easy way to access the various reactor elements. For example, clicking the Rope Collection button opens the Helper category in the Command Panel, selects the reactor subcategory, and selects the RP Collection button.

40C H A P T E R

In This Chapter

Exploring the reactor utility

Learning to use collections

Applying reactor modifiers

Assigning object properties

Working with reactor objects

Previewing animations

New

The reactor menu and toolbar are new to 3ds max 6.

Feature

 

956 Part IX Dynamics

Figure 40-1: Use the reactor toolbar to define physical object properties.

The reactor process

Before getting into the details of reactor, I want to briefly explain the process involved in using reactor. reactor works with geometry that is defined with certain physical properties. After these properties are defined, the reactor engine can take over and determine how all the various objects interact with one another.

Defining geometry with physical properties happens in several different ways. Objects can be added to a collection. A collection is a type of reactor object that has several inherited physical properties such as a Rigid Body collection. Objects can also be linked with reactor objects such as a Spring or Motor. These objects are affected by forces that are preset for the different reactor objects. Finally, you can set properties using the Object Property rollout that lets you define properties such as mass, friction, and elasticity. After all the objects are defined and attached to the correct reaction collection or object, you can open a Preview window that lets you see how the object will react under the current forces. You can also interactively play with the various objects in the Preview window.

When you’re comfortable with the animation, the reactor Create Animation menu command creates all the keys for the animation sequence.

Tutorial: Filling a glass bowl

Imagine trying to animate a bunch of marbles falling into a glass bowl. Using keyframes, determining whether an object overlaps another would be difficult, but with this quick example, we see the power of reactor.

To animate marbles falling into a glass bowl, follow these steps:

1.Open the Glass bowl of marbles.max file from the Chap 40 directory on the CD-ROM. This file includes a glass bowl and several marbles positioned above its opening.

2.Select reactor Create Objects Rigid Body Collection, and click in the Front viewport to create the icon. In the RB Collection Properties rollout, click on the Add button to open the Select Objects dialog box.

3.In the Select Objects dialog box, click the All button and then the Select button to select and make all objects in the scene rigid body objects.

4.Select the Box and sphere objects that make up the floor and bowl, select reactor Open Property Editor, and enable the Unyielding option. This prevents these two objects from moving. Then select the sphere bowl object, and enable the Concave Mesh option.

Chapter 40 Animating with reactor 957

5.Select all the marble objects in the scene, and set the Mass value to 5.0.

6.Then select reactor Preview Animation to open the Preview window, and press the P key to start the simulation.

7.If the animation looks fine, select reactor Create Animation to have reactor compute all the keys.

Figure 40-2 shows the bowl full of marbles positioned using reactor.

Figure 40-2: reactor can compute all the collisions between all these marbles.

Using reactor Collections

One of the first steps in creating with a simulation is defining the object properties. For example, a simple sphere object in Max could represent a bowling ball, an orange, or a tennis ball. Each of these objects responds very differently when being animated to drop on the floor.

In reactor, the simulation identifies the various objects by the type of collection that it is part of. reactor has five different types of collections — Rigid Body, Cloth, Soft Body, Rope, and Deforming Mesh, as described in Table 40-1.

958 Part IX Dynamics

Table 40-1: reactor Collections

Toolbar Button Name

Description

 

 

Rigid Body Collection

Rigid bodies resist a force.

Cloth Collection

Cloth objects flow and bend to all forces.

Soft Body Collection

Soft bodies flex when they come in contact with a force.

Rope Collection

Rope objects support tension, but not compression.

Deforming Mesh Collection

Meshes can be deformed by forces.

 

 

Rigid bodies are objects that keep their shape when pushed; soft bodies deform when pushed. Cloth and rope are intuitive, and deformable meshes are bones and skin systems.

Note Remember that cloth, rope, and soft body objects are only as flexible as the number of segments that make up the object. For example, a rope made from a spline with three vertices bends only in the middle.

All objects that are included in one of these collections behave with similar properties. To include a collection in the scene, select the reactor Create Objects menu or click one of the collection buttons in the reactor toolbar and then click in the active viewport to add the collection icon. Figure 40-3 shows the gizmos for each of these collections.

Figure 40-3: The gizmo icons for each of the collections

Collection gizmos in the scene are not rendered and appear red when first created. When selected, the gizmo appears white; when an object has been added to the collections, it appears blue. This makes it easy to see which collections are empty.

After a collection is added to the scene, you can use its Pick button in the Properties rollout to select a single object to the collection. The cursor changes into crosshairs when it is over an object that can be added to the collection. Or you could click the Add button to open a Select Object dialog box where you can select objects from a list. The collection objects are then displayed in a list found in the Properties rollout. Clicking the highlight button in the Properties rollout briefly turns white all objects that are part of the collection.

Caution

A single object can be added to multiple collections, but this causes a warning to appear

 

when you try to preview the animation.

If an object is selected before you create a collection icon, then the selected object is automatically added to the collection and the collection icon is positioned at the Pivot Point of the selected object or objects.

Chapter 40 Animating with reactor 959

Collection modifiers

If you tried several times to add an object to a Cloth collection with no luck, then this section is for you. Before you can add objects to the Cloth, Rope, or Soft Bodies collections, you need to apply the Cloth, Rope, or Soft Body modifiers to the object. To apply a modifier to an object, select the object in the viewport, choose reactor Apply Modifier, and choose the modifier type to apply. Table 40-2 shows the three reactor modifiers.

Note The Rope modifier can be applied only to splines or shapes.

Table 40-2: reactor Modifiers

Toolbar Button Name

Description

 

 

Cloth Modifier

Allows objects to be simulated as cloth

Soft Body Modifier

Allows objects to be simulated as soft bodies

Rope Modifier

Allows objects to be simulated as rope

 

 

Each of the reactor modifiers has a Vertex subobject mode available in the Modifier Stack. Selecting a vertex allows you to give it different physical properties than the rest of the vertices. For example, you could select the vertices at one end of a rope to have a higher Mass value where it connects with a hook. This end would then fall under gravity before the other end.

Setting object properties

After collections have been added to the scene and objects have been added to the collection, you can define the physical properties using the Property Editor, shown in Figure 40-4. You can open the Property Editor by selecting reactor Open Property Editor. To set the properties for the objects, you need to select the object and not the collection icon. The Property Editor lets you set the properties for many selected objects at the same time. The title bar of the Property Editor identifies the collection whose properties you are setting.

Mass, friction, and elasticity

The Mass property defines how heavy the object is. For example, a bowling ball has a higher mass value than a ping pong ball. The Elasticity value defines how springy the object is; a tennis ball is more elastic than a marble. The Friction value defines how resistant the object is to rolling or sliding along the floor. For example, a brick has a higher friction value than an ice cube.

Tip

A rigid body with a Mass value of 0 does not move in the simulation.

960 Part IX Dynamics

Figure 40-4: The Property Editor can set the physical properties for geometric objects included in the scene.

The Property Editor also includes several other options. The Inactive option removes the object from the simulation calculations. The Disable All Collisions option causes the object to not collide with other objects. The Unyielding makes the object immovable and is good to use for floor and wall objects, and the Phantom option makes objects so they have no impact on other objects in the scene.

Defining collision boundaries

Another common property that you can set pertains to how the object deals with collision detection. You can select the volume to use to determine when two objects collide with each other. If this sounds a bit funny because any collision volume that doesn’t use the actual mesh would be inaccurate, then you need to realize that a complex simulation with lots of collisions of complex objects could take a long time to compute. If reactor only has to compute collisions based on the object’s bounding box instead of the actual mesh object, the simulation runs much more quickly and the inaccuracies aren’t even noticeable.

Before deciding on the collision boundary to use, you need to determine whether an object is convex or concave. A concave objects is an object that you can penetrate with a ray and cross its mesh boundary only twice. Convex objects require more than two crossings with an imaginary ray. You can test whether an object is convex using the reactor Utilities Convexity Test menu command or in the Utils rollout of the Utilities panel with a button named Test Convexity.

A convex objects can use any of the options found in the Simulation Geometry rollout of the Object Properties dialog box, including Bounding Box, Bounding Sphere, Mesh Convex Hull, Proxy Convex Hull, Concave Mesh, Proxy Concave Mesh, or Not Shared as its collision boundary. If a Proxy option is selected, you can select the proxy object using the Proxy button found in the Simulation Geometry rollout.

Chapter 40 Animating with reactor 961

Note

The Material Editor includes a Dynamics Properties rollout with values for Bounce Coefficient,

 

Static, and Sliding Friction. These values are used with the Dynamics utility, but are not used

 

with the reactor engine.

 

Modifier properties

 

In addition to the properties found in the Property Editor, objects that have one of the reac-

 

tor modifiers applied to it have additional properties that are specific to the collection types.

 

These properties show up in the Modify panel when the object is selected.

Note

All the modifiers include an option to Avoid Self-Intersections. Because these object types are

 

flexible, they often move and bunch up together. This option prevents an object from turning

 

inside out and intersecting with itself.

 

For the Cloth modifier, these additional properties include Mass, Friction, Relative Density,

 

and Air Resistance. You can also select to use the Simple Force Model or the Complex Force

 

Model, which enables Stretch, Bend, Shear, and Damping values. You can also define a Fold

 

Stiffness, which determines how stiff the fold in the cloth is.

Note

When similar properties exist for an object in the Property Editor and the Modify panel, the

 

value in the Modify panel takes precedence.

 

The Soft Body modifier adds value for Stiffness and Damping to the Mass and Friction values.

 

You can also select to have the object deform using a Mesh-based or an FFD-based algorithm.

 

The FFD-based algorithm uses control points and is a simpler method that doesn’t require as

 

much memory.

 

The Rope modifier includes Mass, Thickness, Friction, and Air Resistance values. You can

 

also select the rope to be a Spring or Constraint type. Spring ropes act like bungy cords or

 

rubber bands.

Tutorial: Throwing a shirt over a chair

In the preceding example, we looked at something that reactor made much easier, but in this example, we see some animations that would be impossible without reactor. Cloth deformation is very difficult to animate, but the laws of physics know lots about how to describe this motion. In this simple example, we throw a stiff shirt over a stationary chair to see how it reacts.

To animate cloth falling over a hard object, follow these steps:

1.Open the Shirt over chair.max file from the Chap 40 directory on the CD-ROM.

This file includes a chair object and a shirt that is nothing more than an extruded shape that has been sufficiently subdivided.

2.Select reactor Create Object Rigid Body Collection, and click in the Front viewport to create the collection icon. Click the Add button, and select the chair and the floor objects to add them both to the Rigid Body Collection.