Creating reactor Objects


In addition to collections, reactor also includes several default objects that react with the scene in unique defined ways. These objects can be created using the reactor image from book Create Object menu commands or by clicking its icon in the reactor toolbar and dragging in one of the viewports.

The default objects include Spring, Plane, Linear Dashpot, Angular Dashpot, Motor, Wind, Toy Car, Fracture, and Water as listed in Table 37.3.

Table 37.3: reactor Objects
Open table as spreadsheet

Toolbar Button

Name

Description

image from book

Spring

Acts to bring connected child and parent objects closer together

image from book

Plane

Adds a solid plane object to the scene

image from book

Linear Dashpot

Acts to limit linear motion between connected child and parent objects

image from book

Angular Dashpot

Acts to limit angular motion between connected child and parent objects

image from book

Motor

Used to add angular force to the scene

image from book

Wind

Used to add linear force to the scene

image from book

Toy Car

Simulates a simple car with rotating wheels and linear motion

image from book

Fracture

Identifies objects that can be broken into pieces

image from book

Water

Adds water to the scene that conforms to concave surface

The gizmos for these objects, like the collection gizmos, appear red when first created for most of these objects and then turn white when selected and blue when connected to a geometry object. Figure 37.6 shows the gizmo icons for each of these reactor objects.

image from book
Figure 37.6: The gizmo icons for each of the reactor objects

Most of these objects need to be associated with an object to be included in reactor. For example, the Toy Car reactor object must be connected to a geometry object for its chassis and up to four geometry objects for its wheels. This is done by clicking on the respective buttons in the Properties rollout and selecting the geometry object in the viewport. For example, you can connect a Spring object to both a Child and a Parent object. Other reactor objects, like the Plane and Wind objects, do not need to be connected to an object to work.

Springs and dashpots

The Spring and Dashpot objects can be linked between a child and parent object. Simply select the Child button in the Spring Properties rollout, and click the scene object to make the Spring's child. If no parent is selected, the Spring is connected between the child object and the Spring object gizmo's location.

The Align options let you move the Spring to the Child or Parent Body and to use the Child or Parent Space. Selecting the Each Body option positions the Spring object equally spaced between the child and parent.

For the Spring object, you can set the Stiffness, Rest Length, and Damping values and whether it acts on Compression or Extension. The farther the child and parent objects are from the Spring object icon, the stronger the pull toward the icon, so changing the Rest Length value to a small value causes the two objects to be pulled quickly together.

Note 

The child and parent objects still need to be added to a collection such as the Rigid Body collection be used in the simulation.

Dashpot objects work in a similar manner to Springs. They can be linked to child and parent objects and include values for Strength and Damping.

Plane

A Plane object creates a solid wall that objects cannot penetrate if the object belongs to the Rigid Body collection, but only the face with the normal extending from it is solid. This object can be scaled, and its only property is a Show Normal option. Also note that these objects are not renderable and are not visible in the Preview window.

Motor and Wind

The Motor object can be used to spin objects belonging to the Rigid Body collection in the scene. For these objects, you can select a Rotation Axis value, as well as Angular Speed and Gain values.

The Wind object can be used to add a linear force to the scene. The force is directed globally in the direction that is displayed on the Wind object icon, so you need to be careful to place this icon in the correct viewport in order to get the wind blowing in the right direction. The strength of the wind is determined by the Wind Speed value. The wind's ability to move objects depends on its strength and the object's Mass value. Heavier objects are harder to blow away.

The Perturb Speed option lets you make the wind gusty. The Variance is how different its strength is from the base value, and the Time Scale determines how often these gusts take place. You can also set a Ripple option to cause a variance in wind strength Left/Right, Up/Down, or Back/Forward with a given Magnitude and Frequency. You can also perturb time.

The Use Range lets you specify a range on which the wind has an effect. All objects within the set range are influenced by the wind, but objects beyond the range are not. The Enable Sheltering option lets objects positioned behind other objects be sheltered from the wind. You can choose which objects the wind can affect, including Rigid Bodies, Cloth, Soft Bodies, and Ropes.

Toy Car

The Toy Car reactor object is a specific object type that simulates a driving car that produces linear motion by rotating wheels. For this object, you can select a Chassis object that represents the car body and pick a list of objects to act as wheels. For this system, you can specify Angular and Linear Strength values and a Suspension value.

You can also specify the car's orientation using the icon (an arrow points in the direction the car will travel) or using a Common Local Orientation. For the wheels, you can specify to Allow Wheel Penetration, which lets the system have some give as it moves over a rough surface and whether the wheels spin. To give the car some power, you can set the Angular Speed and Gain of the wheels.

For the reactor version 3 engine, an additional set of parameters is available.

Tip 

If you use the reactor version 3 engine with the Toy Car object, then a new set of parameters for controlling its strength, suspension, and breakable threshold are available. This option is new to 3ds Max 9.

Tutorial: Driving a monster truck over a hill

For this example, we take a monster truck model created by Viewpoint Datalabs for a spin over a makeshift hill using the Toy Car reactor object.

To drive a Toy Car object over a hill, follow these steps:

  1. Open the image from book Monster truck.max file from the Chap 37 directory on the DVD.

    This file includes a stripped-down version of the monster truck model created by Viewpoint Datalabs along with a Box object with a Noise modifier to create a hill.

  2. Select reactor image from book Create Objects image from book Rigid Body Collection, and click in the Top viewport to create the collection icon. Then click the Add button to open the Select Objects dialog box. Click the All button, and close the dialog box with the Select button.

  3. Select reactor image from book Create Objects image from book Toy Car, and click in the Top viewport to create the Toy Car object. Click the Chassis button in the Toy Car Properties rollout, and select the truck's body (all parts are attached). Then click the Add button, select the four wheel objects, and click Select. Enable the Allow Wheel Penetration and the Spin Wheels options, and set the Angular Speed for the wheels to 5.0 and the Gain to 2.0.

  4. Click the Select and Rotate (W) button on the main toolbar, and rotate the Toy Car icon in the Top viewport so that it is pointing toward the top of the viewport.

  5. Select the terrain objects in the scene, choose reactor image from book Open Property Editor, and enable the Unyielding option. Then select the truck and its four wheels, and set the Mass value to 5.0 and the Friction value to 1.0.

  6. Select reactor image from book Preview Animation to open the Preview window. A dialog box appears stating that the Chassis object has too many vertices and will not be displayed during the preview. Click the Continue button to close the warning window. Then press the P button to see the animation. The truck approaches the hill and then stops as it starts to climb. Close the Preview window.

  7. Select the Toy Car icon, and set the Angular Speed of the wheels to 15.0 and the Gain to 4.0. Then select reactor image from book Preview Animation to check the animation again. This time the truck makes it over the hill.

  8. To capture the animation sequence, select reactor image from book Create Animation. A warning dialog box appears reminding you that this action cannot be undone. Click OK. Then click the Play button to see the final animation.

Figure 37.7 shows the monster truck as it moves up and over the hill.

image from book
Figure 37.7: The reactor Toy Car object can be used to compute the realistic actions of this monster truck.

Fracture

The Fracture reactor object offers a way to have reactor objects blown apart. The Properties rollout includes a list of Pieces that are to be involved in the fracturing. If you select a Piece from the list, you can designate it as Broken, Normal, Unbreakable, or Keystone, or to Break at Time. The Now button sets the break time to the current frame.

The Use Connectivity option enables linked objects to stay together, such as two parts connected to a spring. You can also select to Break On and set an Impulse value or a Velocity value. The Energy Loss is the amount of energy lost with every collision.

Tutorial: Smashing a gingerbread house

It doesn't matter how many times your mother asks you to not play ball in the house, you always forget. And Murphy's Law says that you'll forget at just the wrong time, like when the gingerbread house has just been finished.

To smash a gingerbread house, follow these steps:

  1. Open the image from book Smashed gingerbread house.max file from the Chap 37 directory on the DVD. This file includes a gingerbread house model created by Viewpoint Datalabs.

  2. Select reactor image from book Create Objects image from book Rigid Body Collection, and click in the Top viewport to create the collection icon. Then click the Add button to open the Select Objects dialog box. Click the All button, and close the dialog box with the Select button.

  3. Select reactor image from book Create Objects image from book Fracture, and click in the Top viewport to create the Fracture icon. Click the Add button in the Properties rollout, select all the objects except for the "Sphere01" and the "ground" objects, and click Select. In the Pieces list of the Properties rollout, select all the objects, enable the Break at Time option, and set the time to 30.

  4. Select the "ground" object in the scene, choose reactor image from book Open Property Editor, and enable the Unyielding option. Then select the "Sphere01" object, and set its Mass value to 60. Finally, select all the gingerbread house objects, and set their Mass values to 20 and the Friction value to 1.0. To be more realistic, you should set the Mass value on the smaller pieces to a smaller value, but for this example, they can all be the same.

  5. Select reactor image from book Preview Animation to open the Preview window. A dialog box appears stating that many of the smaller pieces have a density value that likely is too high, which we already know, so click the Continue button to close the warning window. Then press the P button to see the animation.

    The ball falls, and the house explodes into pieces.

  6. Select reactor image from book Create Animation. A warning dialog box appears reminding you that this action cannot be undone. Click OK. Then after the animation is finished, click the Play button to see the final results.

Figure 37.8 shows the gingerbread house as it fractures into pieces.

image from book
Figure 37.8: The fracture object in reactor can be used to compute realistic explosions.

Water

The Water reactor object creates a realistic surface that acts and behaves like a liquid. For water, you can specify its size in X- and Y-coordinate values and its Subdivisions. Be aware that with inadequate subdivisions, the water does not work realistically. The Landscape option lets you select a surround object that acts like an object with which the water interacts.

You can also set the Wave Speed, Minimum and Maximum Ripple sizes, Density, Viscosity, and Depth. If the Depth option is disabled, then the water has only surface effects.

reactor water is applied as a Space Warp. Space Warps aren't rendered, so to see the water surface, you need to create a Plane object and bind it to the Space Warp using the Bind to Space Warp icon on the main toolbar.

Tutorial: Working with water

One of the coolest features of reactor is its ability to create and simulate the effects of water. Before you can use water, you must have a model that can hold water.

To use reactor to create a body of water, follow these steps:

  1. Open the image from book Pool of water.max file from the Chap 37 directory on the DVD.

    This file includes a pool to hold water created from primitives, along with three spheres of different mass.

  2. Select reactor image from book Create Objects image from book Rigid Body Collection, and click in the Front viewport. In the RB Collection Properties rollout, click the Add button and select all the Box and Sphere objects. Then right-click to exit Rigid Body Collector mode.

  3. Select reactor image from book Create Objects image from book Water, and click and drag in the Top viewport to create the water plane that fills the box. Then drag the water plane upward in the Left viewport to move the water level toward the top of the box.

  4. Select the left sphere in the Front viewport, and open the Property Editor with the reactor image from book Open Property Editor menu command. Set the Mass value to 3 kg. Select the middle sphere, and set its Mass to 100 kg, and then set the right sphere to 5000 kg.

  5. Check the animation in the Preview window by selecting reactor image from book Preview Animation. Press P to start the animation.

  6. Record the animation keys with the reactor image from book Create Animation menu command.

  7. Select Create image from book Standard Primitives image from book Plane, and drag in the Top viewport to create a Plane object that is the same size and density as the Water plane. Then click the Bind to Space Warp button on the main toolbar, and drag from the Plane to the Water Space Warp. Open the Material Editor, and create a material that is light blue with an Opacity value of 20 and a Specular value of 75. Drag this material to the Plane object.

Figure 37.9 shows the simulation in the Preview window. Notice how the mass values determine whether the sphere floats or sinks.

image from book
Figure 37.9: Depending on the mass property, objects sink or float.




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