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 types of collections: Rigid Body, Cloth, Soft Body, Rope, and Deforming Mesh, as described in Table 37.1.

Table 37.1: reactor Collections
Open table as spreadsheet

Toolbar Button

Name

Description

image from book

Rigid Body Collection

Rigid bodies resist a force.

image from book

Cloth Collection

Cloth objects flow and bend to all forces.

image from book

Soft Body Collection

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

image from book

Rope Collection

Rope objects support tension, but not compression.

image from book

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 image from book 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 37.3 shows the gizmos for each of these collections.

image from book
Figure 37.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.

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 image from book Apply Modifier, and choose the modifier type to apply. Table 37.2 shows the three reactor modifiers.

Table 37.2: reactor Modifiers
Open table as spreadsheet

Toolbar Button

Name

Description

image from book

Cloth Modifier

Allows objects to be simulated as cloth

image from book

Soft Body Modifier

Allows objects to be simulated as soft bodies

image from book

Rope Modifier

Allows objects to be simulated as rope

Note 

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

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 37.4. You can open the Property Editor by selecting reactor image from book 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.

image from book
Figure 37.4: The Property Editor can set the physical properties for geometric objects included in the scene.

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 is left out of all calculations and remains stuck in the simulation.

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 option 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.

The Shell value defines an additional radius that surrounds convex shapes and is used for collision detection. If you specify a shell value, the simulation runs much more quickly and the likelihood that objects will interpenetrate each other is much less. The Penetration value is the amount of penetration that is allowed between objects. By providing a non-zero value, the simulation can be solved much more quickly. The Quality settings lets you set how important the object's motion is to the animation. The options include Debris, for objects of low importance; Moving, for objects of medium importance; Critical, for objects that should never penetrate other objects; and Bullet, for objects that move rapidly. The Shell, Penetration, and Quality values work only with the version 3 reactor engine.

NEW FEATURE 

The Shell, Penetration, and Quality settings are new to 3ds Max 9.

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 has only 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 object is one 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 image from book Utilities image from book Convexity Test menu command or in the Utils rollout of the Utilities panel with a button named Test Convexity.

A convex object 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.

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 reactor 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 bungee 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 image from book Shirt over chair.max file from the Chap 37 directory on the DVD.

    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 image from book Create Object image from book 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.

  3. Select the chair and floor object, and choose reactor image from book Open Property Editor. Select the Unyielding option. Then right-click to exit Rigid Body Collector mode.

  4. Select the shirt object, and choose reactor image from book Apply Modifier image from book Cloth Modifier.

  5. With the shirt object still selected, choose reactor image from book Create Object image from book Cloth Collection to create a Cloth collection that contains the shirt object.

  6. Now let's preview the animation before computing it. Select reactor image from book Preview Animation to open the Preview window, and press the P button. When the animation finishes (and the shirt falls on the chair), close the Preview window.

  7. Select reactor image from book Create Animation to have the keys computed for this animation. Then click the Play button to see the final animation.

Figure 37.5 shows one frame of the finished animation.

image from book
Figure 37.5: reactor can be used to simulate cloth falling realistically over a chair.




3ds Max 9 Bible
3ds Max 9 Bible
ISBN: 0470100893
EAN: 2147483647
Year: 2007
Pages: 383

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