Calculating and Previewing a Simulation


Although you've already had some experience with the Preview window in the examples, more controls are available than just playing the animation. To preview the simulation, select reactor image from book Preview Animation or click the Preview Animation button on the reactor toolbar. This opens a Havok window like the one shown in Figure 37.10. This window lets you play with your simulation. The Simulation image from book Play/Pause menu (keyboard shortcut, P) executes the simulation. Dragging with the left mouse button rotates the scene, and you can zoom in and out with the scroll wheel.

image from book
Figure 37.10: The Preview window is a fun place to play with a simulation.

Caution 

The Preview window runs only if the OpenGL or the Direct3D display drivers are used. The window uses OpenGL by default, or you can set it to use DirectX with the DirectX option in the Display rollout The display driver being used is displayed in the title bar of the Preview window.

Using the Preview window

The fun part of the preview window is that you can interact with the objects. Right-clicking (when the simulation is playing) and dragging on the object moves it. If you find a position that you want to capture for Max, you can use the MAX image from book Update Max menu command to set the starting positions of the objects in Max.

Tip 

If the reactor version 3 engine is selected, then you can interact with the objects in the Preview window by holding down the Spacebar and dragging the mouse.

If you want to reset the animation to its starting positions, you can use the Simulation image from book Reset menu command. The Display menu includes several options that you can turn on to change the display. Objects can be seen as Faces or Wireframes. If you have a particularly complex scene to preview, then wireframes may be easy to work with. You can also display the Simulation Edges (which shows the collision boundaries of the objects), Grids, the Origin, and a Flashlight to add light to the scene. The Display menu also includes a Camera Settings option that you can use to set the near and far Clipping Planes and the Preview window's Field of View.

The Performance menu includes options for setting the frames per second and the number of substeps used to compute the simulation. For most animations, the default of 10 substeps is sufficient, but if you want Max to spend more time computing an accurate solution, you can try a higher substep value.

Caution 

Don't use a high value with water.

Creating animation keys

To compute the animation keys for the simulation, select the reactor image from book Create Animation menu command or press the Create Animation button in the reactor toolbar. The progress is displayed at the bottom of the Max interface. You can cancel the simulation at any time with the Esc key.

Note 

After you've clicked the Create Animation menu command, a warning appears stating that the operation cannot be undone.

Analyzing the scene

After the Preview window is opened, a warning dialog box appears if the scene has any errors or warnings that could cause trouble with the simulation. It also warns of unrealistic data, such as property settings that are too high or too low.

Tip 

The one warning that isn't included in the warning dialog box is if objects have no Mass value. If objects in your simulation are just sitting there, then make sure that they have a Mass value.

If you want to check your scene without opening the Preview window, you can use the reactor image from book Utilities image from book Analyze World menu command. This command checks your scene for any trouble and presents problems in a dialog box. If no problems are found, then a separate dialog box tells you that no problems were found.

Tutorial: Dropping a plate of donuts

All the great books have an element of tragedy, so consider a policeman carrying a dozen donuts on a plate when he stumbles and drops the plate. Donuts everywhere, how tragic! This animation sequence would be difficult or at least time-consuming, but not with reactor.

To use reactor to animate a falling plate of donuts, follow these steps:

  1. Open the image from book Falling plate of donuts.max file from the Chap 37 directory on the DVD. This file includes a simple plate of donuts created from primitives.

  2. Select the reactor image from book Create Objects image from book Rigid Body Collection menu command, and click in the Front viewport. In the RB Collection Properties rollout, click the Pick button and select the plate object. Click the Pick button again, and select the Box object that represents the floor.

  3. Select the Torus objects, and choose reactor image from book Apply Modifier image from book Soft Body Modifier (or click the Soft Body Modifier button in the reactor toolbar).

  4. Then select reactor image from book Create Objects image from book Soft Body Collection, and click again in the Front viewport. In the SB Collection Properties rollout, click the Add button and select all the Torus objects again.

  5. Select reactor image from book Open Property Editor, and select the Box object; in the Properties rollout, enable the Unyielding option. Select the plate object, and make its Mass value 5.0. Then select all the donuts, and make their Mass value 0.25. Enable the Mesh Convex Hull option.

  6. The last step is to execute the simulation: Select the reactor image from book Create Animation menu command. It takes some time to compute a solution for this example. When it completes, press the Play Animation button (or press the / key) to see the results.

Figure 37.11 shows the upturned plate of donuts.

image from book
Figure 37.11: Animating these falling donuts, simulated as soft body objects, was easy with reactor.




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