Sunteți pe pagina 1din 132

www.discreet.

com

REFERENCE AND TUTORIALS

21100-010000-5020A July 2002

Copyright 2002 Autodesk, Inc.


All Rights Reserved
This publication, or parts thereof, may not be reproduced in any form, by any method, for any purpose.

AUTODESK, INC. MAKES NO WARRANTY, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, REGARDING THESE MATERIALS AND MAKES SUCH MATERIALS AVAIL-ABLESOLELY ON AN "AS-IS"BASIS. IN NO EVENT SHALL AUTODESK, INC. BE LIABLE TO ANYONE FOR SPECIAL, COLLATERAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH OR ARISING OUT OF PURCHASE OR USE OF THESE MATERIALS. THE SOLE AND EXCLUSIVE LIABILITY TO AUTODESK, INC., REGARDLESS OF THE FORM OF ACTION, SHALL NOT EXCEED THE PURCHASE PRICE OF THE MATERIALS DESCRIBED HEREIN.
Autodesk, Inc. reserves the right to revise and improve its products as it sees fit. This publication describes the state of this product at the time of its publication, and may not reflect the product at all times in the future.

Autodesk Trademarks:
The following are registered trademarks of Autodesk, Inc., in the USA and/or other countries: 3D Plan, 3D Props, 3D Studio, 3D Studio MAX, 3D Studio VIZ, 3DSurfer, ActiveShapes, ActiveShapes (logo), Actrix, ADE, ADI, Advanced Modeling Extension, AEC Authority (logo), AEC-X, AME, Animator Pro, Animator Studio, ATC, AUGI, AutoCAD, AutoCAD Data Extension, AutoCAD Development System, AutoCAD LT, AutoCAD Map, Autodesk, Autodesk Animator, Autodesk Inventor, Autodesk (logo), Autodesk MapGuide, Autodesk University, Autodesk View, Autodesk WalkThrough, Autodesk World, AutoLISP, AutoShade, AutoSketch, AutoSurf, AutoVision, Biped, bringing information down to earth, CAD Overlay, Character Studio, Cinepak, Cinepak (logo), Codec Central, Combustion, Design Companion, Design Your World, Design Your World (logo), Discreet, Drafix, EditDV, Education by Design, Generic, Generic 3D Drafting, Generic CADD, Generic Software, Geodyssey, Heidi, HOOPS, Hyperwire, i-drop, Inside Track, Kinetix, MaterialSpec, Mechanical Desktop, Media Cleaner, MotoDV, Movie Cleaner Pro, Multimedia Explorer, NAAUG, ObjectARX, Office Series, Opus, PeopleTracker, PhotoDV, Physique, Planix, Powered with Autodesk Technology, Powered with Autodesk Technology (logo), RadioRay, Rastation, Revit, Softdesk, Softdesk (logo), Solution 3000, Terran Interactive, Texture Universe, The AEC Authority, The Auto Architect, TinkerTech, Videofusion, VISION*, Visual LISP, Volo, Web-Motion, WHIP!, WHIP! (logo), Wood-bourne, WorkCenter, and WorldCreating Toolkit. The following are trademarks of Autodesk, Inc., in the USA and/or other countries: 3D on the PC, 3ds max, ACAD, Advanced User Interface, AME Link, Auto-CAD Architectural Desktop, AutoCAD Learning Assistance, AutoCAD LT Learning Assistance, AutoCAD Simulator, AutoCAD SQL Extension, AutoCAD SQL Interface, Autodesk Device Interface, Autodesk Map, Autodesk Software Developers Kit, Autodesk Streamline, Autodesk View DwgX, AutoFlix, AutoSnap, AutoTrack, Built with ObjectARX (logo), Burn, Buzzsaw, Buzzsaw.com, Cinestream, Cleaner, Cleaner Central, ClearScale, Colour Warper, Concept Studio, Con-tent Explorer, cornerStone Toolkit, Dancing Baby (image), DesignCenter, Design Doctor, Designers Toolkit, DesignProf, DesignServer, DWG Linking, DXF, Extending theDesignTeam,FLI,FLIC,GDXDriver,gmax,gmax(logo),gmax ready (logo),HeadsupDesign,Home Series,Intelecine,IntroDV,jobnet,Kinetix (logo), Live Sync, ObjectDBX, onscreen onair online, Ooga-Chaka, Plans & Specs, Plasma, Plugs and Sockets, PolarSnap, ProjectPoint, Reactor, Real-Time Roto, Render Queue, Sparks, The Dancing Baby, Transform Ideas Into Reality, Visual Syllabus, VIZable, and Where Design Connects.

Autodesk Canada Inc. Trademarks:


The following are registered trademarks of Autodesk Canada Inc. in the USA and/or Canada, and/or other countries: discreet, fire, flame, flint, flint RT, frost, glass, inferno, MountStone, riot, river, smoke, stone, stream, vapour, wire. The following are trademarks of Autodesk Canada Inc., in the USA, Canada, and/or other countries: backburner, backdraft, heatwave, Multi-Master Editing.

Third-Party Trademarks:
All other brand names, product names or trademarks belong to their respective holders.

Third-Party Software Program Credits:


2002 Microsoft Corporation. All rights reserved. ACIS 19892002, Spatial Corp. AnswerWorks Copyright 19972002 WexTech Systems, Inc. Portions of this software Lernout & Hauspie, Inc. All rights reserved. Certain patents licensed from Viewpoint Corporation. InstallShield Copyrighted 2002 InstallShield Software Corporation. All rights reserved. LLicensing Technology Copyright Macrovision Corp. 19962002. Portions Copyrighted 19892002 mental images GmbH & Co. KG Berlin, Germany. Portions Copyrighted 2002 Blur Studio, Inc. Portions Copyrighted 2002 Intel Corporation. Portions developed by Digimation, Inc. for the exclusive use of Autodesk, Inc. Portions developed by Lyric Media, Inc. for the exclusive use of Autodesk, Inc. Portions of this software are based on the copyrighted work of the Independent JPEG Group. reactor is produced for Discreet, a division of Autodesk, Inc., by Havok.com, Inc. Copyright 19992002 Havok.com, Inc. All Rights Reserved. Please see www.havok.com for details. Wise Installation System for Windows Installer 2002 Wise Solutions, Inc. All rights reserved.

GOVERNMENT USE:
Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth in FAR 12.212 (Commercial Computer Soft-wareRestricted Rights) and DFAR 227.7202 (Rights in Technical Data and Computer Software), as applicable.

Welcome . . . . . . . . . . . . . . . . . . . . . . . . 1
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Advanced Display Features . . . . . . . . . . . . . . . . 5

Rope . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
About These Tutorials. . . . . . . . . . . . . . . . . . . . 33 Creating a Rope Simulation . . . . . . . . . . . . . . . 33

Rigid Bodies . . . . . . . . . . . . . . . . . . . . . . 7
About This Tutorial . . . . . . . . . . . . . . . . . . . . . . . 7 Creating a Rigid Body Simulation. . . . . . . . . . . 8 Rigid Body Properties . . . . . . . . . . . . . . . . . . . . 10 Rigid Collection Properties. . . . . . . . . . . . . . . . 11

Water . . . . . . . . . . . . . . . . . . . . . . . . . . 37
About This Tutorial . . . . . . . . . . . . . . . . . . . . . . 37 Adding Water to a Scene . . . . . . . . . . . . . . . . . 38

Constraints . . . . . . . . . . . . . . . . . . . . . . 41
About This Tutorial . . . . . . . . . . . . . . . . . . . . . . Springs and Dashpots . . . . . . . . . . . . . . . . . . . . Adding a Spring to a Simulation . . . . . . . . . . . Adding a Dashpot . . . . . . . . . . . . . . . . . . . . . . . Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Toy Car . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 42 42 44 45 49

Convex and Concave Objects . . . . . 13


About This Tutorial . . . . . . . . . . . . . . . . . . . . . . 14 Performing a Convexity Test . . . . . . . . . . . . . . 14 Treating an Object as Convex. . . . . . . . . . . . . . 14 Treating an Object as Concave. . . . . . . . . . . . . 16 Building a Compound Rigid Body . . . . . . . . . 17 More About Proxies. . . . . . . . . . . . . . . . . . . . . . 18

Actions . . . . . . . . . . . . . . . . . . . . . . . . . 53
About This Tutorial . . . . . . . . . . . . . . . . . . . . . . 53 The Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Adding Actions to Scenes. . . . . . . . . . . . . . . . . 54

Soft Bodies . . . . . . . . . . . . . . . . . . . . . . 21
About These Tutorials . . . . . . . . . . . . . . . . . . . . 21 Creating a Soft Body Simulation . . . . . . . . . . . 22 More Advanced Soft Bodies . . . . . . . . . . . . . . . 23 Freeform Deformation. . . . . . . . . . . . . . . . . . . . 24

Cloth . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
About This Tutorial . . . . . . . . . . . . . . . . . . . . . . 27 Creating a Cloth Simulation . . . . . . . . . . . . . . . 28 Advanced Cloth Properties . . . . . . . . . . . . . . . 30 Limitations of the Cloth Model . . . . . . . . . . . . 31

10 Animation . . . . . . . . . . . . . . . . . . . . . . 59 About This Tutorial . . . . . . . . . . . . . . . . . . . . . . 59 Creating a Simple Animation. . . . . . . . . . . . . . 59 Mixing Keyframes and Physical Animation I . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Mixing Keyframes and Physical Animation II. . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Deforming Meshes. . . . . . . . . . . . . . . . . . . . . . . 62 Keyframe Reduction . . . . . . . . . . . . . . . . . . . . . 63 Interactive Modification . . . . . . . . . . . . . . . . . . 64

iv

Contents

11 MAXScript and reactor . . . . . . . . . . . . 65 reactor Objects . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Setting Physical Properties . . . . . . . . . . . . . . . . 69 Running Scripts . . . . . . . . . . . . . . . . . . . . . . . . . 72 12 World Scale . . . . . . . . . . . . . . . . . . . . . 75 World Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Collision Tolerance . . . . . . . . . . . . . . . . . . . . . . 76 13 Advanced Simulation Properties . . . . 77

Appendix: Physics Primer . . . . . . . . . . 79


Physical Simulation . . . . . . . . . . . . . . . . . . . . . . 79 Collision Detection. . . . . . . . . . . . . . . . . . . . . . . 90 Physical Units and Values . . . . . . . . . . . . . . . 101 Next Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

Glossary . . . . . . . . . . . . . . . . . . . . . . . 109 Index. . . . . . . . . . . . . . . . . . . . . . . . . . 115

Welcome
reactor is a plug-in for 3ds max designed to allow artists and animators to control and simulate complex physical scenes with ease. reactor supports fully integrated rigid and soft body dynamics, cloth simulation and fluid simulation. It can simulate constraints and joints for articulated bodies. It can also simulate physical behaviors such as wind and motors. You can use all of these features to create rich dynamic environments. Once a designer creates an object in 3ds max, they can assign physical properties to it. Properties could include characteristics such as mass, friction, and elasticity. Objects can be fixed, free, attached to springs, or attached together using a variety of constraints. By assigning physical characteristics to objects, you can model real-world scenarios quickly and easily, and these can then be simulated to produce physically accurate keyframed animations.

With reactor, you can preview scenes quickly using the real-time simulation display window. This window allows you to test and play with a scene interactively. You can alter positions of all physical objects in the scene, dramatically reducing the design time. You can then transfer the scene back into 3ds max with a single key-click, while retaining all the properties needed for the animation. The reactor plug-in frees designers and animators from having to hand-animate time consuming secondary effects, like exploding buildings or draping curtains. The plug-in also supports all standard 3ds max features such as keyframes and skinning, so you can use both conventional and physical animation in the same scene. Convenient utilities (such as automatic keyframe reduction) let you tweak and alter the physically generated parts of an animation after it has been generated. The remainder of this document describes each of the plug-in's features in detail. It also contains detailed tutorials to show you how to get the most from reactor. Further files and tutorials are available at www.discreet.com

Chapter 1: Welcome

Getting Started
The first thing you need to do to use the plugin is to display the reactor panel. The panel contains the options for your simulation, and using it, you can apply physical properties to the objects in your scene.

However, nearly all of the tasks performed within the tutorials have a toolbar and menu equivalent. Detailed below is an explanation for each symbol in the toolbar. This manual discusses all of these functions. Add a Rigid Body Collection. Add a Soft Body Collection. Apply the Soft Body modifier. Add a Constraint Solver. Add a Point-to-Nail Constraint. Add a Spring. Add a Wind Action.

Figure 1.1.1.

To display the reactor panel: 1. Select the Utilities command panel. 2. Click the More button. 3. Select reactor from the list on the Utilities

Add a Motor Action. Open the Preview window. Analyze World. Deforming Mesh. Add a Rope Collection. Add a Cloth Collection. Apply the Cloth modifier.

dialog box (Figure 1.1.1).


4. Click the OK button.

The reactor plug-in contains several extended versions of the default user interfaces, which contain a reactor toolbar and a reactor quad menu. The quad menu is accessible in any viewport using Shift+Alt plus the right mouse button. Both the quad menus and the toolbar provide shortcuts for many of the reactor functions. This manual does not use the toolbar buttons or quad menu functions for its tutorials.

Getting Started

Apply the Attach-to-Rigid Body modifier. Add a Point-to-Point constraint. Add a Point-to-Path constraint. Add a Dashpot. Add Water. Add a reactor Plane. Perform Simulation. Toy Car. Fracture Action. Apply a Rope modifier.

There are usually six steps to creating and previewing a scene with the plug-in:
1. Creating your scene in 3ds max. 2. Applying physical properties to the

objects in your scene using the Properties section of the reactor rollout.
3. Creating collections to which you add

objects.
4. Creating any systems you want in the

scene.
5. Adding cameras and lights. 6. Previewing the simulation.

You do not have to follow these steps in this specific order. It is often practical to create a collection before you add any objects to the scene, for example.
Key P R LMB MMB RMB Function Plays or pauses the scene Resets the scene to its original position (Left Mouse Button) Rotates the scene around the origin Hold the middle button to pan the camera (Right Mouse Button) Picks objects. You can pick up objects by right clicking on them. You then drag the object using a spring connected to the mouse pointer and to the selected object. Lets you move in, out, left and right Displays the Frame Rate

Installing the Toolbar


To install the reactor toolbar:
1. Choose Load Custom UI from the

Customize menu
2. Select the one of the .cui files containing

Arrows F

reactor in its name. These files provide customized reactor versions of the standard 3ds max user interfaces. Alternatively, if you already have a customized UI you can merge the reactor toolbar into it using the merge tool, available at www.discreet.com. Basic Steps

The menu options for the display window are as follows:

Chapter 1: Welcome

Simulation
Play/PauseAllows you to play or pause the

CullingToggles whether or not to cull the

back faces.
Lighting, ShadowsToggles lighting effects/

simulation at any time. When paused, all simulation ceases (objects are frozen in space and time) but you can still change the camera position to view any objects in the scene. You can also step a paused scene forward in single time increments to view simulation progression more accurately. You can then get the layout of the objects in 3ds max to mirror the current simulation world when used in conjunction with the Update Max function. This is particularly useful if you use the preview window to aid object positioning in 3ds max.
ResetResets the simulation to either start or

shadows on and off.


Toggle Display On/OffAllows you to see the

display's effect on the frame rate.

Physics
Real TimeRuns a simulation in real-time, using actual elapsed clock time. Fixed StepAllows you to specify the size of time-step between each physical evaluation. The updated simulation is only available for display after each time-step is taken. If this is a User Defined Step then the value is defined by the 3ds max animation parameters. Smaller timesteps imply more accurate the physics. SubstepsAllows you to specify the number

updated positions in 3ds max.

Display
Max Mouse ModeToggles between the two

mouse modes. The Max Mouse Mode is on by default.


Background ColorSets the background color for the display window. Camera SettingAllows you to set both the distance of the two clipping planes and the field of view for the camera. FlashlightSwitches the default flashlight on

of physical sub-steps taken internally during each evaluation. This controls the accuracy of each time-step evaluation. A larger number of sub-steps mean more accurate time-steps, and more accurate physics.
GravityToggles gravity on and off.

Geometry
FacesToggles whether to display the faces of the objects in a scene. EdgesShows the edges of the objects in a

or off. The flashlight is turned on by default in lightless scenes.


FogToggles fog on and off. Anti-AliasingToggles anti-aliasing on and

scene.
Sim EdgesShows the geometries that are

off, but only if supported by your graphics card.


TexturesToggles between the default colors and textures from 3ds max.

actually being simulated. In reactor, complex geometries can be displayed while the physics actually simulates a much simpler geometry.

Advanced Display Features

Max menu
Update MaxTranslates the positions and

internal states of the objects in the simulation window back into 3ds max.
Use Max ParametersResets timestep and substeps to the values determined by the Animation rollout parameters (used when the preview window was created).

3ds max is linked to a rigid body in the simulation, then the light remains linked during the simulation. It moves and rotates with the rigid body.

Advanced Display Features


All the information contained in this rollout is only useful for the Preview In Window feature. It does not affect 3ds max animations, as 3ds max already has all this information, and of course uses it. Figure 1.4.1 shows the advanced features of the Display rollout. Camera The plug-in allows you to choose a camera in the scene as the display camera, which reactor then uses when the preview starts. Lights Feature You can select up to 6 lights to add to the simulation. If you select none, then a default flashlight is used. The light properties useful for real-time simulation are used and exported. This includes properties such as position, orientation, color, falloff, etc. If a light in
Figure 1.4.1

Shadows The preview window displays real-time shadows. Information associated with these shadows is also exported. While shadows add a lot of realism to scenes, they are expensive and have some limitations. In reactor, shadows can only be cast onto a plane, and can only be cast by lights in the simulation. The default flashlight doesn't cast shadows. You can use these steps to create shadows:
1. Choose the lights from which you want to

cast shadows, open their Modify Branch options and select their Casts shadows checkboxes.

Chapter 1: Welcome

2. Select Cast Shadows on Plane in the

Display rollout.
3. Click the Pick button and select the plane

onto which you want to cast shadows. You can use either a plane object or any other object. The plane used is the one defined by the object local coordinates (located at the pivot and with its normal pointing to the Z direction). If you are casting shadows over another object in the simulation, ensure that the plane where you cast the shadows is slightly above that floor or ground, so shadows appear perfectly over the floor and not covered by it.
4. Disable the shadow casting for objects that

You can set the strength, rest length and damping of the spring from the Display rollout of the plug-in. You can increase the strength if you find it difficult to move the objects, or decrease it if objects move too fast. For an explanation of the parameters, see the Springs & Dashpots section.

don't cast shadows by deselecting their Cast shadows checkboxes. This box is found in the Properties section of each 3ds max object. Texture Quality You can choose the quality of texture maps. A higher number of pixels can improve make your scene's appearance, but also slow rendering and increase file sizes in exports. Values of 128 or 256 are usually fine. The mouse spring In the preview window, you can use the mouse to interact with the scene. Right clicking on a rigid body applies a spring between the mouse pointer and the selected body. You can interact with the objects by moving them, throwing them away, etc.

Rigid Bodies
The most basic components in any scene are usually rigid bodies. Rigid bodies are literally objects that do not change shape. Rigid bodies are commonly used to represent a wide variety of scene components. A rigid body can be anything from a teacup to a table to a very big rock. Rigid bodies are also commonly used as starting points for other kinds of objects. For example, you can create a soft body (a deformable type of object) from a rigid body. reactor handles bodies using entity collections. Entity collection is a specially defined term used to describe the main components of a simulation. A rigid body collection is an example of an entity collection, and rigid bodies are members of rigid body collections. Collections are necessary for the purposes of solving and simulating object movement and interaction.

There are also many physical properties that you can assign to a rigid body. These properties describe the behavior of the body in a scene. They determine the mass, friction, elasticity and other properties of the body.

About This Tutorial


This tutorial introduces the reactor plug-in to new users. It describes how to use reactor to assign physical properties to objects in a simple scene by treating them as rigid bodies. It also describes how to view and interact with the scene in the reactor display window. When you complete this tutorial, you will be able to: Create a rigid body collection. Add objects to a rigid body collection. Add a camera to a scene. Assign physical properties to objects in a scene. Simulate a scene.

Chapter 2: Rigid Bodies

In the Scenes folder in the reactor directory, there are two files associated with this tutorial. They show how your scene should appear at the start and at the end of the tutorial. They are called TutorialOneStart.max and TutorialOneEnd.max.

5. Click any of the view panes to place the

rigid body collection symbol within your scene.

Creating a Rigid Body Simulation


When you create a simple scene, you must add the objects that you want to model in reactor to a rigid body collection. Creating a rigid body collection is usually the first step in using reactor. A rigid body collection is an object used to contain a set of rigid bodies. reactor can only physically simulate rigid-bodies if they are members of a rigid body collection.
To create a simple rigid body simulation: 1. Create a scene containing a couple of

Figure 2.2.1

You can move the symbol around the scene, as its position does not affect reactor. It is better to keep the collection symbol away from your objects to avoid cluttering the scene. You can accept the default name for the rigid body collection, or you can assign a new name. You may add new objects to a rigid body collection as you create it. You can also add objects at any point after the creation of the collection.

simple objects. For example, you create a box with a b ox and sphere above it (Figure 2.2.1). If you don't want to create the scene you can load TutorialOneStart.max
2. Select the Helpers icon from the Create

command panel.
3. Select reactor from the Helpers drop-

Adding Bodies to a Rigid Body Collection


You need to add your objects to the rigid body collection. You can do that in the following way:
1. Select the collection. 2. Click the Modify tab in 3ds max and

down menu.
4. Click the RBCollection button in the

Object Type rollout.

expand the RBCollection Properties (Figure 2.2.2) rollout.


3. Click the Add button. 4. Use the displayed Select Rigid Bodies

dialog box to select the objects that you want to add to the rigid body collection.

Creating a Rigid Body Simulation

Alternatively, you can click the Pick button and select individual objects from the view panes. You now have a rigid collection that you can simulate.

You can also add lights to your simulation. You may add up to six lights to the scene. You can add them to the simulation using the Lights section in the Display rollout. It is not necessary to do this since reactor automatically adds its own light in the preview window. This light is only visible in the preview window, and only added if you specify no other 3ds max lights for simulation. reactor uses a default camera to display a scene in the reactor display window, so this is unnecessary, and this section can be skipped if you wish to use this default camera.

Figure 2.2.2

Assigning Physical Properties


When you have a number of rigid bodies in a rigid body collection, you can assign physical properties to each of the bodies. In fact, you can assign properties at any time before simulation. Physical properties are characteristics such as mass, elasticity, and friction. Each property has a default value.

Adding a Camera
The next step for the simulation is to add a camera to the scene. This means that you can specify the initial view for the display, which removes the need to reposition your viewpoint each time the simulation is run. The 3ds max documentation describes cameras in more detail.
1. Click the Lights and Cameras tab. 2. Click the Targeted Camera icon. 3. Click any of the view panes to place the

camera within your scene. You can adjust the camera so that it is positioned appropriately. If you have decided to use your own camera for simulation, you should expand the Display rollout from the reactor utility and associate your camera with the display. Click the None button beside the word Camera and then select your camera. This associates the camera with the display.

Figure 2.2.3

1. Click the Utilities command panel. 2. Expand the Properties rollout from the

reactor utility.

10

Chapter 2: Rigid Bodies

3. Select one of the rigid bodies from any of

the view panes.


4. Assign appropriate physical properties to

the rigid body by entering values in the Mass, Elasticity and Friction fields. (Figure 2.2.3) For this tutorial, assign a mass of 5 kg to both the small box and the sphere, a mass of 0 kg to the large box and leave the elasticity and friction coefficients at their default values. When an object has a mass of 0 kg, reactor considers it to be fixed, so it cannot move. Other non-fixed objects can collide with it, but it remains in its original position. In this example the small box and sphere falls onto the large box, but the large box is unmoved. 0 kg is the default mass for rigid bodies.

To run the simulation, click the Preview In Window button and reactor displays your scene. As you can see (Figure 2.2.4), the objects in TutorialOneEnd.max have textures. You can apply textures using the Material Editor in 3ds max. To run the simulation, press P. You can move through the view using the left mouse button and interact with objects using the right mouse button. Clicking and dragging with the right mouse button allows you to manipulate objects within the physical world by attaching a spring between the pointer and the selected object.

Rigid Body Properties


This section deals with a number of advanced properties and functions related to rigid bodies.

Get from / Set to Material


This is an option in the Properties rollout of the reactor plug-in. 3ds max provides friction and elasticity properties for materials. You can assign a material to an object. If you want an object to use the properties associated with the material, click Get From Material. If you want all objects with a given material to have particular coefficients, you can alter the properties for one object with the material and click Set to Material. Materials do not affect mass. The friction value shared with 3ds max is the sliding friction value. reactor ignores the static friction value, as it requires only the single friction coefficient for simulation.

Figure 2.2.4

Simulating a Scene
When you have created your scene, you can view the results in real-time, using the reactor display. This display lets you to preview your scene and interact with it.

Rigid Collection Properties

11

Convex / Concave
This affects the way bodies collide with other bodies, and the accuracy of the simulation. This is dealt with in the next chapter.

To use a display proxy, select the object for which you want to use a proxy, check the Proxy option in the Properties rollout, click the None button and select the object you want to use as the display proxy. If you select Display Children, then all children of this object, linked though 3ds max's internal hierarchy, are displayed. You may need to uncheck this box if you get children displaying more than once.

Display Proxies
You can optimize the display frame rate within the reactor preview window by using display proxies. A display proxy literally means that you use one object as a proxy for the display of another. Display proxies are rarely useful for animation, and so this section only really concerns uses for real-time preview of large scenes. With rendered animation, you can devote as much time to physics and display as you require, but real-time requires a different approach. You might use a detailed display proxy with simple physics for complicated interactions or a simple display proxy for commonly repeated objects where the display reduces the speed of the simulation.

Rigid Collection Properties


In the Modify panel for a rigid collection there are two rollouts, RBCollection Properties and Advanced. This section details the extra features not yet mentioned in these two rollouts.

Disabling Collections
Below the list of bodies contained in the collection is a check box labeled Disabled. If any collection is disabled, it is not included in simulation. Any collection you create is automatically included in simulation by default.

Display
It is possible to customize how you display all reactor icons in the 3ds max viewports.

ODE Solvers
You can choose which Ordinary Differential Equation (ODE) solver to use for a particular collection. The four options are:

Figure 2.3.1

For example, if you have a length of chain, you could simulate each link as a thin hollow box, but use the display proxy of a detailed torus (Figure 2.3.1).

12

Chapter 2: Rigid Bodies

Euler The simplest ODE solver and very fast but not sufficient for complicated systems. Back-Euler Slightly more accurate than Euler, but performs worse for spring systems. Interactive scenes that require a mouse spring should use Euler or Runge-Kutta solvers. Midpoint Has a level of accuracy similar to that of Back-Euler, but also does not solve spring systems sufficiently. Runge-Kutta This is the most accurate solver in the system and is used in complicated systems, springs and constraints. Because of its improved accuracy it requires more processor time for the calculation of a step. In general however you shouldn't notice any speed differential between this solver and the others, unless complicated forces (such as wind) are being calculated.

You can set the deactivation energy level in the Min. Energy field. A large energy means objects are likely to deactivate sooner, whereas a small energy means they only deactivate if they are very close to being at absolute rest. The Time and Samples options relate to the measurement of bodies' energies. The Time field determines the period over which the accumulated energy is sampled, and the frequency at which deactivation of objects is considered. For example, a time of 10 seconds means deactivation is only be considered for objects that have accumulated less than Min Energy over a period of 10 seconds. The Samples field determines how many samples are taken over this time to approximate the energy. More samples means better approximation of the body's energy.

Define Collision Pairs


Using this option, you can selectively ignore collisions between objects in the collection. When using this function, you have two windows; one for enabled collisions and the other for disabled collisions. All collisions are enabled by default. A list of the entities in the collection is provided. If you click the names in the list, the Enabled list is refreshed with lines for each object paired with the other entities in the collection. You can then move these collision pairs to the Disabled list. You might use this to ensure that objects that are attached, or overlap, do not cause interpenetrations that slow the system down.

Add Deactivator
A deactivator is an element in a collection that turns objects off when their energy goes below a certain level. Objects that deactivate lose their status as fully dynamic elements of the system, allowing to system to concentrate on the more active objects. This option is selected by default.

Convex and Concave Objects


reactor classifies objects into two types: convex and concave. An object is defined as convex if, given any two points inside the object, you can always go in a straight line from one to the other without going out of the object. Convex objects include spheres, cylinders, and boxes. If an object is not convex, then it must be concave. Concave objects include teapots and (most) landscapes/terrains and rooms. Generally, convex objects are faster to simulate than concave objects. Because of this, you should aim to use convex objects as often as possible for simulation. reactor enables you to treat concave objects as convex so that you can take advantage of their faster processing time. However, there are also cases where it is appropriate to treat a convex object as concave. In reactor convex objects have an "inside" which determines when objects are contained within one another, but concave

objects do not, and so an object entirely within a concave object will not be considered as interpenetrating with that object. You cannot place objects inside a convex object. Instead, you must define an object as concave in order to place objects within it. For example, if you were animating a room, you could design it as a box and treat it as concave, so that you could place objects within it.

Figure 3.1.1

14

Chapter 3: Convex and Concave Objects

About This Tutorial


This tutorial describes the difference between convex and concave simulation geometries in reactor. This tutorial also describes how to group objects together to create a compound rigid body. When you complete this tutorial, you will be able to: Perform a convexity test. Treat an object as convex. Treat an object as concave. Build a compound rigid body.

Treating an Object as Convex


For the purposes of simulation, reactor must define the simulation geometry of a body, which may differ from its display geometry. The most important factor that determines this is whether the object should be considered as convex or concave. Generally, convex objects faster to simulate than concave objects, so it makes sense to treat objects as convex where possible. reactor enables you to treat an object as convex in five different ways. You can: Surround the object with an invisible box (Figure 3.4.1) Surround the object with an invisible sphere (3.4.2) Surround the object with invisible wrapping (3.4.3)

Performing a Convexity Test


If you are unsure whether an object is convex or concave, you can perform a convexity test. reactor enables you to select an object and check its geometry.
To perform a convexity test: 1. Open the Utilities command panel. 2. Expand the Properties rollout from the

reactor utility.
3. Select the object you want to test from any

of the view panes.


4. Click the Test Convexity button. 5. A dialog box containing the result of the

test is then displayed.


Figure 3.4.1

Treating an Object as Convex

15

Substitute the geometry of the object with that of a different convex object (Figure 3.4.4). It makes sense to re-use geometries through substitution because it considerably reduces file size. This is especially useful if you are repeating the same geometry several times in a scene Substitute the geometry of the object with an optimized version of the geometry of the object. Optimization is the process of reducing the complexity (the number of vertices) of a simulated geometry. The display remains the same. The figures above show the actual simulation geometry in each of four cases, using the Sim Edges display option under the Geometry menu in the preview window. In this tutorial, create a scene with a rigid body collection containing a number of simple concave and convex objects. Then follow these steps:
1. Expand the Properties rollout from the

Figure 3.4.2

reactor utility.
Figure 3.4.3

2. Select an object from any of the view

panes.
3. In the Properties rollout select one of the

options from the convex section (Figure 3.4.5). The five possibilities are detailed below.

Figure 3.4.4

Figure 3.4.5

16

Chapter 3: Convex and Concave Objects

Bounding Box
Select the Use Bounding Box option. This uses the tightest world-axis-aligned box.

display in both the preview window and in creating a 3ds max animation. Accurate simulation geometry yields more accurate (but slower) simulation.

Bounding Sphere
Select the Use Bounding Sphere option. This uses the tightest bounding sphere.

Treating an Object as Concave


Many objects you create are concave and cannot be accurately modeled during simulation by substituting them with convex simulation geometries. Also, concave objects can contain other objects, whereas convex objects cannot. So if you are using a box to represent a room, you must treat the box as concave in order to place objects within it. In addition, 3ds max planes must be treated as concave. You can treat an object as concave by using its original mesh. This mesh can be concave. In addition, you can substitute the geometry of an object with that of a nearby concave or convex object, which is considered as being hollow. As with convex objects, you can also substitute an object with a system-generated, optimized version of the object.

Convex Hull
Select the Use Mesh Convex Hull option. This simulation uses the convex hull of this object, which is different from the original if the object is concave.

Substituting the Geometry


Select the Use Proxy Convex Hull option, and select any object from any of the view panes. This substitutes the geometry and the name of the proxy object is displayed on the button below the Use Proxy Convex Hull option.

Substitute for Optimization


Select the Use Optimized Convex Hull option, and use the Min/Max bar to set the appropriate level of optimization. reactor then optimizes the object before every simulation. By running the simulation and selecting Sim Edges from the Geometry menu, you can view the geometries that are physically simulated for the objects. In this way you can always see how accurately your simulation geometry conforms to the display geometry, and hence how likely you are to see any visual disparities between simulation and

Using the Original Object Mesh


To create a box and a number of smaller objects to go into the box, follow these steps:
1. Create a scene with a rigid body collection

containing a box called Box01 and a number of smaller objects that could fit into the box.
2. Open the Utilities command panel. 3. Expand the Properties rollout (Figure

3.5.1).
4. Select the object called Box01 from any of

the view panes.

Building a Compound Rigid Body

17

5. Select the Use Mesh option from the

Concave properties rollout.

Figure 3.5.1

You can treat any convex geometry as a concave one. This results in slower simulation, but such objects can hold other objects. The likely places for using concave objects are for solid bodies that need more accurate simulation, or for bodies that have no volume - such as planes or meshes that are not closed.

reactor now treats the object as concave.

Substituting the Geometry of an Object with a Proxy Mesh


Using the same box and smaller objects from the pervious example, you can use a proxy mesh to treat the box as convex, as follows:
1. Open the Utilities command panel. 2. Select the Use Proxy Mesh option. 3. Select one of the concave objects in the

Building a Compound Rigid Body


reactor can join several meshes together to create a more complex body. Rigid bodies in reactor are usually composed of one or more primitives. Primitives are the basic elements that make up objects. Primitives can be planar, spherical, or geometric. Rigid bodies composed of more than one primitive are called compound rigid bodies. Rigid bodies have elasticity and friction. Primitives each have mass, whose sum determines the mass of the compound body. Compound rigid bodies are useful if you want to simulate an object with uneven density, or a concave object that can be decomposed into several convex segments. Compound objects provide an interim between convex and concave bodies, in that they are faster to simulate than concave objects and allow you to do things like place objects within them. However, they are less accurate in simulation than true concave objects. You build compound rigid bodies using the Group function within 3ds max. For more information on groups, see the 3ds max documentation.

scene. The geometry is substituted and the name of the concave object displays on the button below the Use Proxy Mesh button.

Substituting the Geometry of an Object with an Optimized Mesh


You can use an optimized mesh to treat the box as convex, as follows:
1. Open the Utilities command panel. 2. Select the Use Optimized Mesh option. 3. Use the Min/Max bar to set the

appropriate level of optimization. reactor now optimizes the object before every simulation.

18

Chapter 3: Convex and Concave Objects

To build a compound rigid body and include it in the simulation, follow these steps:
1. Select the objects that you want to group

from any of the view panes.


2. Select Group from the Group menu on the

main application screen. The objects are now treated as a single compound rigid body. They now move as if stuck together and no report no collisions between any pairs of primitives in the same body. When you have created a group it is necessary to add the group to the rigid collection. The rigid collection cannot contain both primitives and their group. If you want to use display proxies with groups you can only apply a proxy to the entire group and not to elements of the group. To apply a display proxy to a group you need to open the group and then select the group name from the Select by Name list. To select just the group name you select Display Subtree within the select list window and then you can apply a display proxy as normal within reactor. You can only apply a display proxy if the group is open. You cannot use a compound body as a simulation geometry proxy.
Figure 3.6.1

More About Proxies


When animating complex objects, you may decide that the object would have the same behavior if it were simulated with a simpler geometry. For example, you could have a ring displayed with a highly tessellated torus that it improves its display, but which could be simulated with a less tessellated torus to improve the speed of the simulation.

More About Proxies

19

Geometry Proxies
Geometry proxies allow you to use a different geometry for the simulation that the one you are actually going to animate and display in 3ds max. Select the Use Proxy Convex Hull option if you want to use another object's convex hull, or Use Proxy Mesh if you want to use the mesh of another concave object. There are several cases where you might want to use proxy geometries: While you probably want to animate and display a highly tessellated torus, you want the simulation and the preview in window to be fast. Substituting the simulation geometry of the torus for a simpler one allows you to do that. (Figure 3.7.1)
Figure 3.7.2

You might also use the same geometry in many places. Using the same proxy geometry for each object creates only one instance of geometry, which is shared by all objects during simulation. This helps to reduce the amount of information exported, the loading a creation of the scene, and the amount of memory used. Primitives use proxy geometries, which means that you can define different proxy geometries for the primitives inside a compound rigid body, but not for the compound body itself.

Optimized Geometries
reactor can automatically create proxy geometries. In fact, when you choose Use Bounding Box, or Use Bounding Sphere what you are actually creating is a simple proxy geometry. The Use Optimized Convex Hull and Use Optimized Mesh options automatically create an optimized version of your geometry and use it as a proxy. They internally apply the Optimize modifier to the mesh. However, it is recommended that you create you own optimized geometries if you want full control over the results.

Figure 3.7.1

20

Chapter 3: Convex and Concave Objects

Display Proxies
Display proxies substitute the actual rigid bodies when they are displayed at run-time. They are mainly useful for real-time application developers who want to preview and export display information. If you select a display proxy for a rigid body, the rigid body display is substituted by the display of the chosen node and its children during the reactor run-time simulation. That means you can simulate quite a simple body but display a very complex object. This is similar to what you can do with geometry proxies, but there are important differences:
1. While geometry proxies apply to

You can create both the simple and complex object, set the properties on the simple object and add it to the simulation. Perform the simulation, and once it is finished, you can match the positions of the simple and complex objects, and then link the complex object to the simple one. The complex object will follow the same animation of the simple one. In this case, you should not render the simple object when rendering.

Useful Hints
If you check the Geometry / Sim Edges option in the preview window you will be able to see the geometries that are actually being used in the simulation.

primitives, display proxies apply to rigid bodies


2. When you are creating an animation in

3ds max, the animated bodies are the ones added to the simulation. Display proxies don't play any role in creating 3ds max animations, since they are only used for real-time display. Another important reason (for real-time developers) for using display proxies is similar to the one explained in the previous point about geometry proxies. If you are displaying the same object in many places, you should use display proxies that point to the same object so the display object will only be created/exported once with the subsequent saving in time and memory.

Other Alternatives for Animators


While geometry proxies and display proxies are very useful and powerful, there are other alternatives for animating a given body using a different one in a simulation.

Soft Bodies
A soft body is a body whose geometry deforms due to physical interactions. They can bend, flex, stretch and other similar movements. Soft bodies have a wide number of uses, but they can be more demanding and slow a real-time simulation down. As with rigid bodies, soft bodies operate through collections. These are called soft body collections. Soft body collections perform the same functions as rigid body collections. Soft body have a greater range of physical properties to properly describe their motion than rigid bodies. These include properties such as damping, smoothing and stiffness. The properties are applicable to soft bodies in addition to the rigid properties of mass and friction. Most soft bodies that you create using 3ds max use a rigid body as their initial starting point. You normally create a soft body by first creating the rigid shape of the

body and then turning it into a soft body. There are two ways of defining a soft body in reactor , depending on whether you use the FFD modifier. As in previous chapters, the bulk of this chapter consists of two tutorials that will guide you through the two possible processes of soft body creation.

About These Tutorials


There are two tutorials in this chapter. The first tutorial introduces reactor soft bodies to users. It describes how to use reactor to create a simple scene with soft bodies. It also describes the effects generated by varying the parameters for soft bodies. When you complete this tutorial, you will be able to: Create a soft body collection. Add objects to the soft body collection. Assign physical properties to soft objects in a scene.

22

Chapter 4: Soft Bodies

In the Scenes folder in the reactor directory, there are two files associated with this tutorial. They show how your scene should appear at the start and at the end of the tutorial. They are called TutorialTwoStart.max and TutorialTwoEnd.max.

Change their friction to 0.9 so our star rolls instead of sliding.


3. Add a rigid body collection to your scene. 4. Add the planes to the rigid body

collection.
5. Select the star, expand the Modify section

and select reactor SoftBody from the drop-down list.

Creating a Soft Body Simulation


When creating a simulation that contains soft bodies, you use techniques similar to rigid body simulation. You create the objects in 3ds max. For objects that are soft you apply a Soft modifier and include them in a soft body collection. You add this soft body collection to the simulation in the same way as a rigid body collection. You should take care not to include the objects in both the rigid and soft collections. When you apply a modifier to a rigid object to make them soft, its rigid equivalent still exists in the scene.

Figure 4.2.1

Soft Body Properties


In the Properties rollout for the SoftBody modifier you can set physical attributes for objects. There are four main options for the physical properties of a soft body. Mass This mass applies to the soft body. Though you may have applied a mass in the Properties section from the reactor Utility, the soft body won't have the correct mass unless it is applied here.

Simple Soft Body Creation


You can follow these steps to create the tutorial soft body:
1. Create a scene as detailed in Figure 4.2.1.

To create a star, choose star from the shapes menu and then apply the extrude modifier. You should also create three standard planes rotated to roughly 30, 0 and -30 degrees. If you don't want to create the scene you can load TutorialTwoStart.max
2. Select a concave mesh for each of the

planes in the Properties rollout from the reactor utility. Standard 3ds max planes require a concave simulation geometry.

More Advanced Soft Bodies

23

Stiffness Changing this value changes the stiffness of the body. Valid values are between 0 and 1000, where 1000 relates to the stiffest value. The default value is 0.2. If you set a value over than 1, reactor applies the default value. Damping This is the damping coefficient for the oscillation of the body's compression and expansion, with values are between 0 and 1, where 1 provides the greatest damping. Friction This is the coefficient of friction for the body's surface, similar to the corresponding coefficient for rigid bodies.

When you pick up a soft body with the mouse, it flexes. This is due to the fact that the mouse actually connects a spring between the nearest vertex and the mouse pointer. The strength of the spring can be adjusted.

Creating and Adding Bodies to a Soft Collection


You must add your soft body to a soft body collection. The button for a soft body collection is in the Create panel, in the Helpers option. It is a reactor option. Follow these steps to assign the tutorial soft body to a collection:
1. Select the reactor drop-down menu, and

click the SBCollection button.


2. Select the collection symbol. 3. Open the Modify tab and click Add or
Figure 4.2.2

Pick to select the soft bodies from the available list.


4. Click the Preview in Window button and

More Advanced Soft Bodies


Soft Bodies require accurate simulation. As a result, you may find that you need to set the accuracy level of the simulation much higher than that needed for rigid bodies. The best way to customize this is by using the Scale

reactor displays your scene.

24

Chapter 4: Soft Bodies

Timestep parameter in the Advanced rollout of the soft collection containing the bodies. Typically, fewer vertices in a soft body result in faster physical calculation. You can have smooth soft bodies. Certain techniques, such as applying the Mesh Smooth modifier from 3ds max after the Soft Body modifier are sometimes preferable to simply increasing the number of vertices in a body. For animation, the accuracy can be improved by increasing the number of substeps per keyframe. You can also improve display simulations in the preview window by reducing the size of the timestep or increasing the number of substeps per timestep.

Disabling Collections
You can temporarily remove an entire soft body collection from simulation by checking this box.

Advanced Soft Collection Options


The Modify panel for a soft body collection has an Advanced rollout. Unlike rigid bodies, you cannot change the energy threshold for soft bodies, as soft bodies cannot be deactivated. You also cannot ignore collisions between soft bodies in a soft body collection. The Scale Timestep parameter changes the internal integration step of the soft collection. If the soft body is behaving in an unstable or unrealistic manner, you can set this parameter to less than 1 to force the collection to take a proportionally smaller timestep. You can achieve faster simulation by increasing this parameter. The integrator then integrates at a higher than the default timestep. However, there is a risk of instability in doing this.

Fixing Soft Objects


To fix certain points in objects to world space, you need to apply the Soft Body modifier to a subset of the object's vertices instead of to the entire body. You can use the Mesh Select modifier in 3ds max to select vertices, before you apply the Soft Body modifier. You select the points in the object that you want fixed, invert the selection and when applying the soft body modifier, you check the NonSelected are Fixed option.

Freeform Deformation
One of the better tools that you can use in reactor for soft bodies is the FFD (Freeform Deformation) tool. The FFD tool lets you encase a soft body in a simple mesh, and use the mesh for calculating the physics of the body. Using this tool, it becomes much easier to deform soft bodies, and less expensive on system resources. The trade-off with FFD soft bodies is that they are less accurately modeled than other soft bodies.

Smoothing
Within the Soft Body modifier is an option called Smooth Level that allows you to apply iterative subdivisions to the mesh, which is a useful tool to add a smoother appearance to the soft body. There are three levels from 0 to 2 iterations of subdivision. This subdivision is only applicable in real-time simulation. It is useless for animation. You should apply this modifier before applying the reactor Soft Body modifier.

Freeform Deformation

25

This second tutorial covers FFD soft bodies. When you complete this tutorial, you will be able to create an FFD soft body. In the Scenes folder in the reactor directory, there are two files associated with this tutorial. They show how your scene should appear at the start and at the end of the tutorial. They are TutorialThreeStart.max and TutorialThreeEnd.max.

Mesh Selection for FFD's


Unlike standard soft bodies, you cannot directly select from the FFD which vertices or control points should be soft. Within the modifier's Properties rollout is a box diagram that represents the sides of the FFD box as part of the FFD (un)selection panel. If you apply the modifier and select the Box Faces radio button, you can choose any of the box sides. You can set the chosen box sides to be set to fixed, ignored or unyielding. The box is oriented x right, y forward and z upward.

Creating an FFD Soft Body


This tutorial shows you how to create a soft body that uses freeform deformation.
1. Create a teapot above a plane mesh. Add

the plane to a rigid body collection. You can load the scene directly from TutorialThreeStart.max
2. Select the teapot and, under the Modify

panel, select FFD (box) from the dropdown list.


3. From the modifiers select reactor

SoftBody.
4. Under the properties rollout for the

reactor SoftBody modifier, click the FFDBased button. (Figure 4.4.1)


5. From the Helpers option in the Create

command panel, select reactor.


6. Select SBCollection and add a soft body

collection to the scene. You can now add the teapot to the soft body collection and preview the scene. The FFD box surrounds the teapot. The deformation of this mesh represents the deformation applied to the teapot, so its parameters may be previewed and tweaked to your liking.

Figure 4.4.1

26

Chapter 4: Soft Bodies

Another method of selection is using the Volume button. You can create another volume that intersects the FFD's volume. Then, you select the Volume button and choose this second volume as your deselecting volume. This results in the None button acquiring the name of your new volume, and all the point of the FFD mesh that coincide with the new volume becoming de-selected. You can also change the original FFD configuration. You might wish to do this to get a better fit between the FFD and the underlying geometry. This gives you more accurate collision detection with the geometry, and a more accurate simulation.

which the stable configuration presides. This frame number is then entered into the Frame field under Stable Configuration in the soft body modifier's Properties.

Figure 4.5.2 - A Deformed Teapot

Clicking the Conform to Shape button under the properties for the FFD gets 3ds max to try to fit the object's points to the shape of the mesh in so far as they can. Alternatively you can alter the mesh by selecting the Set Volume SubObject button from the modifier, which allows you to move the FFD points without affecting the underlying mesh. To use an FFD configuration other than the original box you must select the Frame at

Cloth
reactor can physically model and simulate cloth. A cloth may appear to be a soft body, but there are some major differences. The principal difference between a soft body and a cloth is that soft bodies are threedimensional, whereas cloths are twodimensional. A cloth is composed of a mesh of triangles that have physical properties. You can use them to simulate clothes, trampolines, sheets of metal and other two-dimensional items. Theoretically, you could use soft bodies for some of these purposes, but a cloth is much more practical because there is no need to simulate a negligible volume. As with other body types, cloth bodies need to belong to an entity collection in order to function properly. Cloths use cloth collections . Cloths have physical properties similar to other bodies. They also have some values specific to themselves, such as buoyancy, which are necessary to compensate for their two-dimensional nature.

About This Tutorial


You can create cloth objects using the modifier reactor Cloth. In this tutorial you will create a table, an object on the table and a cloth above it. The cloth drops onto the table and the object. By the end of the tutorial you will be able to: Create a cloth and cloth collection. Add objects to a cloth collection. Assign physical properties to cloths in a scene. In the Scenes folder in the reactor directory, there are two files associated with this tutorial. They show how your scene should appear at the start and at the end of the tutorial. They are TutorialFourStart.max and TutorialFourEnd.max

28

Chapter 5: Cloth

Creating a Cloth Simulation


To change an object in 3ds max to a cloth, you apply a modifier to it and the object's mesh is used to define a two dimensional cloth.

simulation. You can create cloth from any mesh in 3ds max.
2. Select the new plane, open the Modify

panel.
3. Select reactor Cloth from the drop-down

list of modifiers.
4. In the Properties rollout for the Cloth

Simple Cloth Creation


To start this tutorial, reproduce the scene as displayed in Figure 5.2.1. The floor is a plane, the table is a compound rigid body and the cups, saucers and spoons are rigid bodies. Give these objects properties through the reactor utility and add them to a rigid body collection. Add a camera and two lights and put them in the simulation. If you don't want to create the scene, you can load TutorialFourStart.max

modifier set physical attributes for the object. There are several options for the physical properties of a cloth. Mass This is the object's mass for reactor. Stiffness The stiffness of the cloth, with values between 0 and 1. Damping This is the damping coefficient for the oscillation of the cloth's shape. Valid values are between 0 and 1, where 1 provides the greatest damping. Friction The coefficient of friction for the cloth's surface.

Figure 5.2.1

Follow these steps to create the tutorial cloth: 1. Draw a small plane centered over the table

and a small distance above it. The plane shouldn't be overly tessellated, as this slows simulation down. You should set the resolution to 8x8, for more accurate

Creating a Cloth Simulation

29

Rel Density As cloth has no volume, a density for the cloth cannot be calculated. So there is a buoyancy property for cloths, which reflects its relative density. Its default value is 1, the density of water.

Intersection You can set a cloth not to intersect with itself by checking Avoid Self-Intersections. Deformation You can apply a level of deformation constraint using Constrain Deformation. The deformation constraint percentage represents how much the cloth can stretch. A low value means it hardly stretches. Vertex Selection Allows certain points of the cloth to be fixed in world space. You can apply this modifier to the entire body, or a selection of the body's vertices. Depending on the selection, you can select options such as Non-selected Are Fixed to fix the position of certain features in world space. Smooth Level Applies iterative subdivision during real time simulation. Air Resistance This is the damping coefficient for the oscillation of the rope's compression and expansion. Valid values are between 0 and 1, where 1 provides the greatest damping.

Adding Bodies to a Cloth Collection


You can create a cloth collection in much the same way as any other type of entity collection. To add a cloth collection, you open reactor. Then you click the CLCollection button and add a collection to the scene. To add cloths to the collection select the collection and click Add or Pick.

Figure 5.2.2

30

Chapter 5: Cloth

Click the Preview in Window button and reactor displays your scene. Cloth collection optimization is similar to soft body collection optimization. High levels of smoothing may lead to apparent intersections of the cloth and other objects. These are not actually there in the simulation, which accurately simulates the underlying mesh. Using the on Avoid SelfIntersections option results in more accurate simulation of the cloth at the cost of an increased simulation time. For a large mesh this can be very slow.

Complex Force Model This is a more accurate model of cloth dynamics, which incorporates independently adjustable stretch and shear properties, as well as a physically accurate out-of-plane bend property. The damping parameters in both models control how quickly the cloth dissipates energy as it changes shape. There is no correlation between the meaning of a value in one model and any value in the other model. A stiffness of .2 in the simple force model does not correspond to stiffness of .2 in the complex model, in terms of cloth behavior.

Advanced Cloth Properties


In the Properties section for cloth are several additional properties that you can use to better define the physics of your cloths.

Fold Stiffness
Fold stiffness provides you with an additional method for adding stiffness to a cloth. It also controls the degree to which a cloth is able to bend, which in turn affects how it folds. Cloth behaves like loose materials such as silk by default. Fold stiffness allows you to simulate stiffer materials such as wool or linen. With high degrees of fold stiffness, you can even simulate sheet metal. There are two types of fold stiffness: Simple Fold Stiffness and Complex Fold Stiffness.

Force Models
There are two kinds of force model: Simple and Complex. Each allows you to model the forces that affect a cloth in different ways, with the trade between the two options being one of system resources. Complex forces are more accurate, but more expensive to use and therefore sometimes unsuitable to your needs. Simple Force Model The simple model is fine for most situations. Stiffness determines the stiffness of the cloth, incorporating both stretch and shear stiffness properties.

Limitations of the Cloth Model

31

Simple Fold Stiffness Simple fold stiffness adds fold stiffness uniformly across the surface of a cloth, regardless of its topology. It has one parameter, Stiffness, which controls the fold stiffness.

Spread Angle Spread angle controls the degree to which fold stiffness is added to cloth that has a nonflat shape. The angle relates to the threshold angle between two parts of the cloth below which stiffness is added. Split Angle This controls the degree to which fold stiffness is added, specifically how fold stiffness is concentrated along the grid lines of the original cloth mesh. Complex fold stiffness is most useful for adding fold stiffness to cloth such as dresses. In this case you may only want to add stiffness to areas of the dress that are flat. This can be achieved by setting Spread Angle to zero, i.e. fold stiffness will not be added to any part of the cloth that is curved.

Figure 5.3.1

Complex Fold Stiffness Complex fold stiffness is used to add additional stiffness to cloth. Complex fold stiffness provides more parameters, which in turn control how fold stiffness is added to and affects cloth. Stiffness Controls the stiffness of the fold stiffness. Distance Distance controls the degree of fold stiffness per unit area. A distance of 2 refers to twice the average triangle edge length in the cloth. Therefore a large distance value results in a large concentration of fold stiffness per unit area.

Limitations of the Cloth Model


Problems can occur during complex interactions between cloth and rigid bodies. Reducing the timestep can solve many problems. The Scale Timestep parameter in the cloth collection changes the internal integration step of the collection. The model does not work well for very large meshes, as it has been developed primarily for real-time uses. At polygon counts of greater than 3000, things can get very slow. If you do need to create large cloths, then using a larger triangle size is generally preferable.

32

Chapter 5: Cloth

Using Update Max


Usually in a scene you do not want your cloth to start off in an animation as a flat plane or as its original configuration. For example, you might want it to drape around a body. To achieve this, you can use the Update Max function from the Preview window. Create a scene with cloth and preview it. Within the Preview window, position the cloth as you would like it to be at the start of your animation and then select Update Max from the Max menu in the window. When you return to 3ds max the scene will have updated to represent the changes you made in the Preview window. This is very useful for getting curtains to hang in folds, or for getting a dress to hang properly around a body from the start of an animation.

Figure 5.3.2

Constrain Deformation can cause heavy system usage in some situations, especially when the cloth stiffness is low. It can cause cloth-to-cloth and cloth-to-rigid body interactions to behave less effectively. It is important to know that you can create cloth from any mesh in 3ds max. Although a square grid based triangulation may be the default for many meshes, this can result in visual artifacts during cloth simulation, particularly due to collinear creasing. It is advisable to try and use a more irregular triangulation of the mesh, such as the Delaunay triangulation of a 3ds max Nurbs surface. (To obtain this triangulation, select the Surface Approximation rollout in the Nurbs modifier panel. Select Advanced Parameters, and check the Delaunay check box in the Advanced Surface Approximation dialog.)

Create a rope collection.

Rope
You can create ropes using any of the objects from the Shapes tab within 3ds max. As with other object types in the system, ropes operate in entity collections. They are called rope collections. They perform the same functions as rigid body collections. Most ropes that you create use a spline. You normally create a rope by first creating a spline and then turning it into a rope by applying a modifier. There are two ways of simulating rope in reactor , depending on whether you wish to use a spring or constraint based model. This chapter consists of one tutorial that guides you through making a rope in a scene.

Add objects to the rope collection. Assign physical properties to ropes in a scene. In the Scenes folder in the reactor directory, there are two files associated with this tutorial. They show how your scene should appear at the start and at the end of the tutorial. They are called TutorialfouraStart.max and TutorialfourbEnd.max.

Creating a Rope Simulation


When creating a simulation that contains ropes, you use techniques similar to soft body simulation. You create the splines in 3ds max, and apply a Rope modifier. You also include them in a rope collection. You should take care not to include the objects in both the rigid and soft collections. When you apply a rope modifier to an object, its rigid equivalent still exists in the scene.

About These Tutorials


There is one tutorial in this chapter. It describes the creation of a rope with a fixed end and a free end. It also describes the effects you can achieve by varying the parameters for the rope. When you complete this tutorial, you will be able to:

34

Chapter 6: Rope

Simple Rope Creation


The following steps create the tutorial scene:
1. Create a scene as detailed in Figure 6.2.1.

8. Select Constraint from the Rope Type

option within the modifier.

To create the helix, select Helix Shape from the Shapes tab. Add the sphere a small distance below the helix so that if the helix was fully relaxed it would reach the plane.
2. Select Use Bounding Sphere for the

sphere in the Properties rollout from the reactor utility, as described in the previous section.
3. Add a rigid body collection to your scene. 4. Add the plane to the rigid body collection
Figure 6.2.1

Rope Properties
In the Properties rollout for the Rope modifier you can set physical attributes for your rope. There are five main options for the physical properties of a rope. Mass This mass applies to the rope. Though you may have applied a mass in the Properties section from the reactor utility, the rope can't have the correct mass unless it is applied here. Note that the stiffness of the rope is also linked to the rope's mass. If a heavy mass is attached to a rope, increasing the mass improves the rope's strength and reduces the stretch. Thickness Changing this value changes the thickness of the rope within the simulation (splines do not have an intrinsic thickness).

(but do not add the helix) .


5. Select the helix, expand the Modify

rollout, and select Normalize Spline. This splits the spline into segments of equal length. Within this modifier set the segment length to between 5 and 10.
6. Select Spline Select from the list of

modifiers. By default, Spline Select selects vertices. This suits our purpose in this case. Select all of the vertices from the helix except the center one.
7. Apply the reactor Rope modifier from the

list of modifiers.

Creating a Rope Simulation

35

Air Resistance This is the damping coefficient for the oscillation of the rope's compression and expansion. Valid values are between 0 and 1, where 1 provides the greatest damping. Friction This is the coefficient of friction for the rope's surface, similar to the corresponding coefficient for rigid bodies. Rope Type This defines the type of rope model used for simulation. Either spring or constraint may be used. When minimizing stretch it is advisable to use the constraint model.

1. Select the reactor drop-down menu, and

click the RPCollection button.


2. Select the collection symbol, open the

Modify tab, click Add and select the ropes from the available list. You can also click Pick and select the bodies manually from the view-panes.
3. If you have added a camera, ensure that it

has been positioned correctly and any lights you might require have also been added.
4. Click the Preview in Window button and

reactor displays your scene. When you pick up a rope with the mouse it flexes. This is due to the fact that the mouse actually connects a spring between the nearest vertex and the mouse pointer.
Note: In order for wind and water to affect rope you need to specify the rope's thickness value as greater than 0. This provides a surface area that the forces which wind and water apply can affect. The thicker the rope the greater the surface area. The greater the effect the wind has, the larger the ripples and greater the buoyancy for water interaction. Note: can avoid self intersections in a manner much the same as cloth. However, there is one important difference. You must set the thickness of the rope to a value greater than zero. Otherwise, you may get results wherein the rope may appear to self intersect. This is because a rope with zero thickness has no effect on whether its display shell intersects. The 3ds max spline display thickness does not affect the reactor rope thickness, so simply changing the displays thickness would not solve this problem.

Figure 6.2.2

Creating and Adding Ropes to a Rope Collection


When you have created a rope, you must add it to a rope collection. The button for a rope collection is in the Create menu, in the Helpers option. You can follow these steps to assign the tutorial rope to a collection.

36

Chapter 6: Rope

Water
Water is the reactor representation of bodies of fluids that you can use to enhance a scene. Objects can interact with water in physically realistic ways, including ripples and waves. Water can also have different densities, which is a crucial factor in determining whether an object floats or sinks. The buoyancy properties for objects other than cloth are calculated automatically from the shape and mass properties for the objects. Water in reactor is a space warp that is simulated as water when brought into the display simulation. Since you cannot render space warps, you must provide water with a graphical representation. In preview mode, you can see a representation, but in a proper simulation, water does not appear. You can give water a graphical representation by binding a plane to the water space warp. In fact, you can bind the warp to any sort of object.

About This Tutorial


In this tutorial you will learn to use reactor Water. By the end of this tutorial you should be able to: Add water to a scene. Set properties for the water. Bind the water to a non-physically simulated element in the scene. In the Scenes folder in the reactor directory, there are two files associated with this tutorial. They show how your scene should appear at the start and at the end of the tutorial. They are called TutorialFiveStart.max and TutorialFiveEnd.max.

38

Chapter 7: Water

the scene in a similar way to a plane by clicking and dragging in any window.
2. Reposition the water so that it's at an

appropriate water level for the pool. (Figure 7.2.3).


3. Select the water and then click the Modify

tab. You can now see a list of physical parameters that you can set for the water. These are the parameters you can set for water:
Figure 7.21

Subdivisions X/YSets the tessellation of the

water's mesh.

Adding Water to a Scene


Using Water in a Simple Simulation
Reproduce the scene as shown in Figure 7.2.1. There are five fixed boxes with zero mass, which act as a pool, a camera and two lights. Create the rigid collection for the boxes.

LandscapeWhen selected and associated

with a rigid body then the waves reflect off the sides of the chosen rigid body and refract through narrow openings.

Figure 7.2.3 Figure 7.2.2

If you don't want to create the scene, you can load TutorialFiveStart.max. To add water to the pool, use the following instructions.
1. Choose reactor from the Space Warps

Wave SpeedThe speed at which wave crests propagate across the surface of the water.

Min/Max RippleAllows you to set bounds on the size of the waves generated in the water.
DensityThe density of the liquid. It

menu on the Create panel. Click the Water button (Figure 7.2.2). You add the water to

determines which objects sink and the height at which objects of a lesser density float.

Adding Water to a Scene

39

ViscosityThis is a measure of resistance to

flow and thus how difficult it is for objects to move through the liquid. A larger value means that the motion of objects through the water is highly damped.

points in the direction of motion. Note that objects may deactivate during simulation if they have a deactivator, even if they're still in the water.

Animating Water for 3ds max Water in Motion


If you click the Preview in Window button, you can able to see the water in the pool. The next step is to add some objects that you can drop into the water and see how they react to the water and how it reacts to them. The next step is to provide a representation for 3ds max so that you can render the scene for pictures or animations. Draw a plane of the same size as the water and in the same position and orientation. Select the Bind to Space Warp icon from the Main toolbar, click the plane and drag to the water. When you render it, you should see your plane. You can apply materials to the plane and it renders as such. Binding a plane to the water applies a modifier to the plane within which you can set the scale strength for the deformation. For example, if you set the scale strength to 2, then any water deformation is doubled for the plane.
Figure 7.2.4

If you make an animation with the water, the plane mimics the water's behavior and you can render the animation.

Add two boxes above the water and give them a mass. Note that this mass should be large enough to make the objects slightly less dense than water (density of water is 1000kg/m3). Add them to the collection and preview the simulation again. When you play the simulation, the boxes fall into the water and bob around. Try dragging the boxes under the water and letting them go. You can try adding a strange shape into the water. If you drag it through the water, it reorients to the path of least resistance. For example, if you try dragging a stick through the water edge on, it reorients so that its tip

Figure 7.2.5

40

Chapter 7: Water

Constraints
Suppose that you create a scene in which you want to tightly control the movement of physical objects. Perhaps you want to make two objects constantly spring together, or have one object hinged onto another. To achieve these kinds of motion restriction, you use constraints. Constraints limit the behavior of objects, fixing them to points in space, or objects. There are a number of constraint systems in reactor . The most robust are point-topoint, point-to-path and point-to-nail constraints. There are also two basic types of constraint called springs and dashpots. Springs and dashpots tend to be faster, but more elastic in nature. A spring is an elastic connection between two objects. A dashpot is similar, but more flexible. It allows for elastic connection of two objects with a point, or an object with a point in space. Dashpots can also constrain the position and orientation of objects.

The final section of this chapter describes the reactor toy car object, which is built from various types of constraint. It is meant only as something with which to play. It is too simple for simulating a real car model, but may be useful as a quick way of getting a car-like model up and running.

About This Tutorial


The first part of this tutorial covers the full implementation of a spring. The second part discusses the implementation of a dashpot. The remaining constraints (simply called "constraints") are described in detail on page 45. When you complete this tutorial, you will be able to: Distinguish between springs and dashpots Add a spring Change the properties of a spring Add a dashpot Change the properties of a dashpot

42

Chapter 8: Constraints

In the Scenes folder in the reactor directory, there are two files associated with the spring tutorial. They show how your scene should appear at the start and at the end of the tutorial. They are called TutorialSixAStart.max and TutorialSixAEnd.max.

angular. Linear dashpots force objects to try to share a point in space. The objects can move freely about this space, but always have this point in common. Angular dashpots force objects to attempt to keep their relative orientations. If you rotate one, the dashpot tends to reduce that rotation while also applying a turning force on the other so that their orientations are equal.

Springs and Dashpots


The spring system adds the action of a Hookean spring between any two rigid bodies. You can control and change the properties of the spring. For example, you can alter its stiffness, rest length, and damping value. Rest length is the extent of the spring when it applies no force. A spring always works to attain its rest length. A rest length of zero ensures that the spring will always work to bring the objects together. Dashpots always have zero rest length. Damping is the process of gradually reducing a vibrating motion. A high damping value results in a spring that oscillates very few times before returning to its rest length. A highly damped spring appears to have very little energy. A low damping value results in a spring that keeps extending and contracting around its rest length for a long time. You can also suppress the extension or the contraction action of the spring. For example, a rubber band is an example of a spring with suppressed extension. If you disable both, the spring no longer works. Dashpots are like springs with a very high damping value. Dashpots enable you to predict and control the motion of objects. There are two types of dashpot: linear and

Adding a Spring to a Simulation


Using the spring system, you can add a spring between two rigid bodies. reactor also enables you to specify where the spring should be attached to each rigid body. To do this, you have to add a point to each rigid body. Create a scene containing a rigid body collection with two spheres and a plane. The scene may be created from scratch or you can load in the file TutorialSixAStart.max.

Figure 8.3.1

1. Select the Helpers icon from the Create

command panel within 3ds max.


2. Select reactor from the Helpers drop-

down menu.

Adding a Spring to a Simulation

43

3. Click the Spring button in the Object

1. Select the Helpers icon from the Create

Type rollout (Figure 8.3.1).


4. Select a view pane to draw a line

command panel within 3ds max.


2. Select Standard from the Helpers drop-

anywhere in the scene.


5. Click the None button beside Object A in

down menu.
3. Click the Point button in the Object Type

the Spring Properties rollout.


6. Select one of the spheres in a view pane.

rollout (Figure 8.3.2).


4. Click in the view pane where you want the

The sphere is now associated with one end of the spring. The name of the sphere is displayed on the button beside the words, Object A.
7. Repeat these steps to associate the second

point.
5. Click the button labeled None beside

sphere with the Object B button. You must select the points to which the spring should attach. You can either select an actual point or an object, in which case that object's pivot is used as the point. A point does not have to be on either of the objects in a spring. Its position is be fixed relative to the object and the spring forces are applied at that point for the object. If the precise point on each object is irrelevant, you can re-select the objects that you have identified as Object A and Object B, and use their pivots.

Point A in the Spring Properties rollout and select the point or object you want to associate with Object A in any of the view panes.
6. Repeat these steps to associate a point with

Object B. The next step is to set the properties for the spring. You can modify its properties either during creation or after it has been created. Select the spring from the view panes, or from the Select by Name list, and click the Modify tab. The Spring Properties rollout is displayed (Figure 8.3.3).

Figure 8.3.2

For a spring, the process for creating and using a point in reactor is:

Figure 8.3.3

44

Chapter 8: Constraints

From the Spring Properties rollout, you can set the following features: StiffnessThe strength and stiffness of the spring Rest LengthThe length at which the spring does not exert a force. DampingWith valid values between 0 and 1, this relates to how the speed at which the spring comes to rest. Act on compressionThis setting turns off the spring compression. Act on extensionThis setting turns off the spring extension. You can preview your spring by clicking the Preview In Window button from the Display rollout in the reactor utility. If you grab one of the spheres using the right mouse button and drag it across the plane, the second sphere acts as if there is a spring between it and the first (Figure 8.3.4). The spring itself is not displayed in the preview window.

Adding a Dashpot
The effects of dashpots vary depending on the kind of dashpot and whether it connects two objects, or a single object and a point. If you add a linear dashpot, connecting a body and a point, the body attempts to occupy the location of the point. The body can rotate freely around the point. If you add a linear dashpot connecting two bodies with a point, reactor establishes the point's positioning with respect to each body. This is called referencing the point in body space, and it creates two entries, one for each body. As the dashpot is applied between the two bodies, the forces caused by the dashpot are applied to the bodies at their established points in body space, and attempts to return the body's to their original relative positioning. If you add an angular dashpot connecting a body and a point, the body attempts to keep its initial orientation. The location and orientation of the point are irrelevant, but it must be added for consistency with other dashpots. The angular dashpot does not hold the body in space. If you want a body suspended in space that maintains its orientation with reference to a point, you need to apply a linear dashpot or constraints to hold the body in position. If you add an angular dashpot between two bodies, a turning force is applied to each body that attempts to maintain the current orientation between the two bodies when one of the bodies rotates.

Figure 8.3.4

Constraints

45

You can add dashpots are in the same way as springs. From the Modify Properties rollout for the dashpot, you can set the relevant properties. Dashpots are set as a linear dashpot for one object by default. The object and point are set in exactly the same way as for the spring. The Strength parameter for a dashpot is equivalent to the Stiffness parameter for a spring. The difference between the point parameter for a one-object dashpot and a spring is that it takes the position of the point or object in world space, and this is where the dashpot is attached. For example, if you want to attach a dashpot between a sphere and a point in world space, you would place an object (the sphere itself or a point) in the world space position to which you want to associate the dashpot and select this object for the dashpot's point parameter. To set a dashpot between two rigid bodies you need to select the box beside Body B from the Properties rollout in the dashpot's Modify section. The Strength and Damping parameters of the dashpots should be tuned to the masses of the bodies to which they are attached. A heavier body may need a stronger dashpot to hold it. Instability of dashpots may result from a high timestep, low number of substeps, a poor integrator, or a very high strength.

Constraints
Constraints refer to the remaining constraint systems, other than springs and dashpots, which you can use to constrain the movement of soft bodies, rigid bodies and cloth. They are in general more robust than other types of constraint systems, but can be more expensive to simulate. The point-to-point, point-to-path and pointto-nail constraints use constraint solvers. These constraint solvers perform all the calculations needed for each constraint. They are only applicable to rigid bodies, and automatically added to the system for a particular rigid body collection. Although it is really a system, a constraint solver may be thought of as a collection for constraints. Where you previously created a rigid body collection for rigid bodies, here you create a constraint solver for constraints. This solver acts upon all interacting constraints for a particular rigid body collection. One type of constraint, Attach to Rigid Body, doesn't use a solver but instead is applied as a modifier. This constraint attaches all or selected vertices from a cloth, soft body or rope to a rigid body. An example is a flagpole where two points from a square cloth have been attached to the pole.

46

Chapter 8: Constraints

Constraint Solver
To add a constraint solver to a system, select CSolver from the reactor section (Figure 8.5.1) and click in one of the view panes to place it in the scene. Using Pick and Add from the Properties rollout for the solver you can add constraints to the solver at creation or afterwards in the Modify tab.

Within the properties for the constraint solver there are three options for the type of solver you would like to use: Cheap, General and Expensive. Cheap is the least accurate but the fastest and Expensive is the most accurate but slowest. The default value is General, which handles most situations.

Figure 8.5.2 Figure 8.5.1

You also need to associate a rigid body collection with the solver. Click the button under RBCollection within the solver's Properties section and select the collection on which the solver's constraints work. A solver can only solve constraints acting on bodies in one collection. It cannot span multiple collections. If you add constraints that work on objects from a collection other than that associated with the solver, the Analyze World utility notifies you when you try to run the simulation.

Point-to-Point Constraint
A point-to-point constraint constrains two bodies to share a common point.
1. Draw two boxes and a point somewhere

near them.
2. Add them to a rigid collection. 3. In the reactor section, select Point-Point. 4. Click anywhere in the scene to add the

constraint.
5. You have to add two objects and one point

to the constraint using the appropriate buttons from the Properties rollout for the constraint.

Constraints

47

You can set the strength of the constraint using the Strength field. A point-to-point constraint is like an infinitely small double ball and socket joint applied at the point and connected to the bodies. In Figure 8.5.2 the two boxes are the objects and the double ball and socket joint is the location of the point. The point is always in the same local position for each body. Moving one body affects the other through the constraint at this point.

The point-to-path constraint is just a point-tonail constraint where the nail is allowed to move along a confined path. If the path is a set of line segments, the constraint may stick slightly at each joint along the path.

Figure 8.5.4

Point-to-Nail Constraint
A point-to-nail constraint constrains a body's motion to a point in world space (fig 8.5.4). You create it in much the same way as a point-to-point constraint but you only need to specify one body and one point. The constraint restricts the body's motion so that it is always the same distance from the point. If you choose the constrained body as its own point (i.e. the pivot of the body) then the constraint works to prevent any linear motion in the body. Point-to-nail constraints need to be added to a constraint solver to affect the simulation. Two point-to-nail constraints can be used to define an axis of rotation for an object by placing them at two separated points along the desired axis.

Figure 8.5.3

Point-to-Path Constraint
A point-to-path constraint constrains a body to a given path (fig 8.5.3). The body can rotate freely but its linear motion is limited to the path.
1. Open the Create panel and select Shapes. 2. Draw a line or curve. 3. Add the Point-to-Path Constraint by

selecting Point-Path from reactor and clicking in one of the view panes.
4. Choose the object you want constrained,

the point you want the object constrained to and the line or curve you want as the path.

Figure 8.5.5

48

Chapter 8: Constraints

reactor AttachToRB
The AttachToRB (Attach to Rigid Body) constraint is a modifier for soft bodies and cloth (fig 8.5.5). You can apply the AttachToRB constraint to cloth and soft bodies and perform such tasks as hanging flags and curtains or building trampolines.
1. To apply the modifier, you use Mesh

A Quick Example of reactor AttachToRB


Create a cylinder with zero mass for a flagpole. Add a small plane (or other mesh) at the top of the pole to represent the flag. Add the pole to a rigid body collection (Figure 8.5.6). Add a couple of lights and a camera to the simulation. Increase the tessellation of the flag plane slightly. Perform the cloth modifier on the same plane. Create a cloth collection and add the cloth to it.
1. Select Modify and open the drop-down

Select and select the points of your body that you want to attach to the rigid body.
2. Open the Modify section, click More

and select reactor AttachToRB.


3. From the Properties rollout for the

list of modifiers.
2. In the Mesh Select option, choose the

modifier, select the rigid body to which you would like to attach the body.
4. Decide whether you would like the

Vertices option.
3. Select the two corners of the plane nearest

connected body to affect the rigid body and whether or not you want to ignore collisions between the rigid body and the attached body. You will find the sample file for the following completed tutorial, TutorialSixB.max in the Scenes folder.

the pole (select the first vertex, hold down Ctrl and select the other).
4. Select reactor AttachToRB. 5. In the Properties section of the modifier

click the button under Rigid Body and then click the flagpole in the view pane (Figure 8.5.7).

Figure 8.5.6

The Toy Car

49

6. Run the simulation.

The Ignore Collisions option determines whether collisions between the body and the cloth/soft body are ignored or not. The FFD Soft Bodies Only constraints are applied as described on page 24.

The Toy Car


An example of several constraints in operation on a series of objects is the toy car object, which has been included in reactor as a fun timesaver for designers. The toy car is a model car that you can manipulate easily to create your own vehicles for scenes in a lot less of the time than it would take to create one from scratch. What follows is a sample tutorial on using the car. In the Scenes folder in the reactor directory, there are two files associated with this tutorial. They show how your scene should appear at the start and at the end of the tutorial. They are called TutorialSixCStart.max and TutorialSixCEnd.max.
1. Create the scene as detailed in Figure 8.6.1.

Figure 8.5.7

Notice that there isn't really any point in using the AttachToRB modifier here as the flagpole is fixed. This means you simply select all of the points you wanted to be nonfixed and selected the Non Selected Are Fixed option when applying the cloth modifier. However, if you give the flagpole a mass and run the simulation again, you can pick up the flagpole with the mouse and wave it in the air just like a real flag. The Do not affect rigid body option determines whether forces received by the soft body are imposed on the rigid body. All forces received by the rigid body are automatically imposed on the cloth.

A box is placed above a plane for a chassis and four equal cylinders are placed as wheels. Add all of the objects to a rigid body collection. Alternatively, you can load in TutorialSixCStart.max.

50

Chapter 8: Constraints

The car won't move automatically. However, if you drag the chassis, the car rolls on its wheels when you release it. To make the car's wheels spin on their own within the simulation, select Spin Wheels from Toy Car Properties in the Modify panel. You can then select a Maximum angular speed for the wheels and a gain that represents the rate at which the wheels reach their Maximum angular speed. The final scene is in TutorialSixCEnd.max.
Figure 8.6.1

2. The mass parameters are very important

for a toy car, ideally the mass of the chassis should not be much greater than the total wheel mass and the density of the bodies should be such that they don't generate any warnings from Analyze World. Apply such a mass to your car objects.
3. From reactor, select Toy Car and add a car

to the scene by clicking in one of the viewports.


4. Reorient the car's icon so that its

You must decide which directions represent the spin (wheel axle axes) and suspension direction. If you use the Icon Orientation, then this is sufficient, and the local orientation of the wheels and chassis (given by their 3ds max pivots) need not be aligned in world space for the car to work. Otherwise, you may align the wheels and chassis pivots in world space, and use the Common Local Orientation to specify which axes represent the suspension and spin directions.

Toy Car Parameters


There are several properties that you can manipulate to alter the car's behavior: Allow Wheel PenetrationSwitches off collision detection between the chassis and the wheels. Internal SubstepsAllows the car to take more substeps per keyframe than the surrounding simulation. This is useful as sometimes if the car has strange parameters, which require more substeps for stability. Common Local OrientationUsually it is easier to use Icon Orientation to define the orientation of the car. However, you can define the suspension and spin axes for the chassis and wheels. If you bring the chassis

orientation is the same as the chassis. This allows you to use the icon orientation as a guide for the directions of the suspension and wheel axle axes.
5. Click the Chassis button from the Toy Car

Properties and then select your chassis in the view pane.


6. Click the Add button under the wheels list

and from the resulting list of objects select your wheel objects.
7. Make sure that Icon Orientation is

selected from Toy Car Orientation and then preview your simulation.

The Toy Car

51

and wheel pivots to a common orientation then with respect to this orientation you can manually set the axes for suspension and spin with the respective options. Angular StrengthThis represents the strength of the corrective forces applied to keep the wheels upright and pointing forwards. Linear StrengthThis represents the strength of the forces applied to keep the wheels in position relative to the chassis. SuspensionSets the stiffness of the suspension for the car. The lower the value the more the chassis will bounce while having forces applied to it. DisabledRemoves the car from the simulation.

52

Chapter 8: Constraints

Actions
Action is a group name used to describe several complex physical systems that are available to you in reactor . They are grouped under this name simply to differentiate them from constraint and water systems. The action systems allow you to simulate wind, motors and fractures in scenes. This chapter takes you through the process of learning about each of the different types of action.

The completed files for the tutorials at the end of the chapter are included in the Scenes folder. They are TutorialSevenA.max, TutorialSevenB.max and TutorialSevenC.max.

The Actions
reactor currently comes with three actions, each of which is detailed below.

Wind Action
This adds wind to a scene. Wind is represented by the symbol of a weather vane. The direction of the rooster determines the direction of the wind. You can decide which types of object the wind affects, be they cloth, soft or rigid. You can also set the wind speed, introduce variance into the wind's strength, apply a ripple to the wind along an axis and apply a variance to this ripple. You can also activate the ability of objects to gain shelter from the wind due to the position of other objects.

About This Tutorial


During this tutorial you will see the actions that have been included in reactor. By the end of this chapter you will: Know the various types of action available to you in the plug-in Be able to implement these Actions in your scenes

54

Chapter 9: Actions

Motor Action
This allows you to apply a motor action on any element in the scene. For example, if you want to add a fan to your screen, you can constrain the fan to the roof leaving a rotation axis, and then apply a motor action to the fan about this axis. The action requires you to supply a rigid body, and affects the selected body. You must also specify the axis around which rotation occurs.

Adding Actions to Scenes


Wind Action
This example steps through adding a wind action to a scene with a long curtain hanging in front of a window. The finished file is TutorialSevenA.max.

Fracture Action
Simple fractures reflect the ability of compound rigid bodies to break apart after a given impulse has been applied. You add the fracture to the scene and those elements that are in the fracture set are added to the action's set. You associate a rigid body collection with the action. Those elements involved in the fracture action need only be included in the fracture. They don't have to be included in the rigid body collection. You can decide whether pieces are normal or whether they have special properties that determine when they can or cannot break off. Fracture actions only work for non-fixed rigid bodies.

Figure 9.3.1

1. Create a floor (plane) and a wall of with a

hole in it where the window should be.


2. Add a plane to cover the hole. 3. Using the Mesh Select modifier, select the

plane excluding its points in line with the top of the window and apply the reactor Cloth modifier.
4. Select the Non-Selected Are Fixed option. 5. Add the floor and wall to a rigid body

collection and the cloth to a cloth collection.


6. Treat the wall as concave. 7. In reactor, select Wind and click

somewhere in one of the view panes.

Adding Actions to Scenes

55

8. Rotate the symbol for the wind so that the

wind is blowing towards your window.


9. Select the Enable Sheltering option.

(Figure 9.3.2).

Preview the simulation. The wind should blow through the window and affect the curtain. By selecting Perturb Speed, you can modify the wind's strength. The Variance value varies smoothly over time. The Time Scale determines how quickly this occurs, with small values producing a slow change and large values producing rapid change. With the Ripple check box selected, the direction becomes a function of space and time. This effect can occur in the Left/Right, Up/Down or Back/Forward directions with Forward being along the wind direction, and Up being the up-axis of the wind icon. For example, a curtain hanging down might require ripples active in the Left/Right direction. The Magnitude determines the directional variance and the Frequency determines the regularity of ripple formation. Low values means distant ripples, high values means closely packed ripples. If the Perturb Time check box is selected, the spatial perturbation is itself perturbed over time, which causes the ripples to move back and forth. If this is not checked, the cloth should come to rest, unless Perturb Speed is checked.

Figure 9.3.2

10.Make sure that only cloth is selected in the

Applies To... section.

56

Chapter 9: Actions

Motor Action
In the example, you will create a windmill with spinning blades. The finished file is TutorialSevenB.max.

8. Select the blades and set which axis

represents the one around which you want the blades to rotate (in body space).
9. Select the Motor symbol and, in the

Modify section for the motor, select the axis that you noted for the blades.

Figure 9.3.3

Figure 9.3.4

1. Create a truncated cone and reduce the

number of segments to four to create a windmill.


2. Make some blades as a compound rigid

body.
3. Constrain the blades in front of the

Preview the simulation. The blades should spin. The Ang. Speed is the speed the motor tries to maintain, and the Gain is how fast it recovers when blockage or other forces slow the blade.

windmill and along the axis of rotation using two point-to-nail constraints. Set the constraints strengths to 50. (Figure 9.3.3).
4. Add a CSolver system and add the

Fracture Action
The following short tutorial creates a table and breaks it during a simulation using the fracture action. The finished file is TutorialSevenC.max.
1. Create a table and give each element mass

constraints to it.
5. Add a Motor Action to the scene from

reactor. Set the Ang Speed to 10.0 and the Gain to 3.0.
6. Click the rigid body button in the motor

as though you were going to create a compound rigid body, but don't actually group them.
2. Create a plane onto which the table can

action's Properties rollout (Figure 9.3.4) and select the blades.


7. In the dropdown menu for the coordinate

reference system, select Local.

fall. Create a rigid body collection and add only the plane to it (Figure 9.3.5). Add the Fracture Action to the scene from the reactor options.

Adding Actions to Scenes

57

3. Click the Rigid Body Collection button

within Fracture and then click the rigid collection that contains the plane.

The Energy Loss determines how much energy is lost during the fracture. A value of 0 means no energy is absorbed, so the body is quite brittle, a value of 1 means the body is brought to rest during fracture. Energy Loss only has effect if the fracture is set to Break during collision. The tutorial uses an energy loss of 0.7.

Figure 9.3.5

4. CSelect Add under the list in Fracture

Properties and select the table elements from the list.


5. Select the tabletop element from the

Figure 9.3.6

Fracture Properties list and select Unbreakable from the options. This means the legs break off the table and not the other way around.
6. Position the table so that it is at an angle

and a good bit above the plane. Preview the simulation. When the table drops onto the plane one or more of the legs should break off. If they do not then most likely the impulse setting of the fracture action is too high. Try lowering it. . A Normal piece breaks off when sufficient impulse is received. An Unbreakable piece never breaks off by itself. Keystone pieces cause the entire object to fracture if they break off.

If the fracture is set to Break during collision, the body breaks and continues to move under its own momentum, but loses energy. If it is set to Break after collision, then the body bounces before breaking. Pieces from this kind of collision retain the original bodys momentum of their original body after the collision. The current version of reactor does not display texture information for fracturing bodies in the preview window. This does not affect animation in 3ds max.

58

Chapter 9: Actions

By the end of the tutorial you will be able to

Animation
reactor has the ability to feed physical

Create a physical animation Use 3ds max Keyframes with reactor Use unyielding bodies Interact with your scene and update 3ds max to reflect the interactions

simulations into keyframed animation. It is often an intricate process to achieve the ideal blend of keyframed animation and physical simulation, and reactor provides a number of mechanisms for helping you to get the most from reactor physics. At a basic level, the physical simulation can assume control of the entire scene and feed directly into the 3ds max 4 animation. At a more sophisticated level, keyframed bodies can interact with the physical simulation.

Creating a Simple Animation


You can create a simple animation by following these simple steps. The tutorial creates a series of balls rolling down a ramp and into a bucket1.

About This Tutorial


This tutorial deals with animating in 3ds max using reactor. There are several ways that you can animate objects, while capturing the physical simulation data. These range from simple animations that are entirely composed of physical data, to more sophisticated animations in which there is a mix of keyframed and physical bodies.

Figure 10.1.1

1.

In some demo versions of reactor, you cannot simulate this many bodies for the specified number of frames.

60

Chapter 10: Animation

1. Create the bucket as in Figure 10.1.1. The

bucket is a Boolean compound of two cone segments in 3ds max. Use a concave mesh with zero mass.
2. Create the ramp, which is simply an

keyframe, so a lower ratio for frames per keyframes and a greater number of substeps taken per keyframe improves the accuracy of the animation.
10.To slow down or speed up the animation

angled box.
3. Create ten balls, each with a mass of 2 kg.

The example uses geo-spheres. Create the first sphere just above the top of the ramp and, while holding down shift, drag the sphere vertically so that a copy is placed just above the original position and not interpenetrating. Select 9 for the number of copies you want. Use a Bounding Sphere for the ball simulation geometry to treat the sphere as convex.
4. Create a floor plane, and make sure to use

so that its rate is different to that in the real world, you can change the time scale. Values less than 1 reduce the speed, while values greater than 1 increase it.
11.Click Perform Simulation in the Animation

rollout from the reactor utility to perform the simulation and create the 3ds max keyframes.

a concave mesh simulation geometry for the floor plane.


5. Add all of the bodies to a rigid collection. 6. Run the simulation to see what the

animation will look like. Use Preview in Window in the Display rollout from the reactor utility.
7. Open the Animation rollout from the

Figure 10.2.2

reactor utility (Figure 10.2.2).


8. Decide the frames you want to simulate

using Start and End Frame. For this animation choose 0 to 600.
9. Every frame in this animation is a

You can view the keyframes by sliding the Animation bar in 3ds max and render the animation as you would any other.

keyframe, so leave the Frames/Key value at 1. To increase the accuracy of the animation you can increase the number of substeps per keyframe using Substeps/Key. A reactor simulation step is taken every

Mixing Keyframes and Physical Animation I

61

Mixing Keyframes and Physical Animation I


You can use keyframes defined before simulation to give bodies initial velocities. Using the scene from the above example, you can create an animation with a moving body by following these steps.
1. Clear the keyframes for all of the objects

6. Set the Start Frame to the current frame in

the Animation rollout from the reactor utility.


7. Click Perform Simulation.

and add a large sphere about the size of the bucket.


2. Give the sphere a large mass and add it to

The initial position and start frame position are compared and the ball is given an appropriate initial velocity. The ball should fly into the side of the bucket and knock it over, spilling the balls that have fallen into the bucket onto the floor. Before precalculating for the entire animation, you could remove the smaller balls from the rigid collection so that you can quickly get the correct position for the large sphere to ensure that it hits the bucket. Then you could add them back in for simulation.

the rigid collection.


3. Give the bucket a non-zero mass so that it

can be knocked over.


4. In the first frame place the sphere so that it

is a good horizontal distance from the bucket. Making sure that the sphere is selected, press the Spacebar to lock the selection set.

Animation for FFD's


You can animate FFD soft bodies, as you can animate any other type of body.
1. Using the teapot example from chapter 4,

change the soft properties of it to a mass of 4 kg and a stiffness of 0.1.


2. Open the Animation rollout from the

reactor utility.
3. Set the Start Frame to 0, the End Frame to

150 and Substeps/Key to 5,


4. Select Update Viewports and then click

Perform Simulation.

Figure 10.2.3

5. Click the Animate button from the

Animation section in 3ds max. Scroll the Animation bar to frame 50 and drag the

sphere in the direction of the bucket.

You can see the teapot squash and change shape as it bounces on the floor as the keyframes are created. One of the main advantages of using an FFD mesh is that the complexity of the underlying mesh may be altered after the keyframes have been created. Thus, increasing the segment value under the Modify panel may change the teapot's mesh complexity.

62

Chapter 10: Animation

Mixing Keyframes and Physical Animation II


You can keyframe the motion of objects using standard 3ds max tools, and physically simulate the same frames without any fear of your keyframed motion being affected. Selecting the Unyielding property in the Properties rollout from the reactor utility specifies that an object is unaffected by collisions with other objects. Other objects will naturally bounce off the unyielding object. This method is preferable for accurate simulations instead of the alternative of not including the objects in the rigid body collection and keyframing them (since this would result in them not interacting at all with any physical objects and appearing to pass right through them). Unyielding objects are otherwise normal objects and you may attach springs and dashpots to them. In the Advanced rollout from the reactor utility there is an option called Unyielding: Updates/ Frame. Before starting a simulation, reactor locates the position and orientation of the unyielding bodies at different times. During the simulation, the engine will interpolate between these positions & orientations. The number of positions taken from 3ds max is set with the parameter Updates/Frame. You don't normally need to change this value. Decreasing it speeds up the animation, and increasing it has the opposite effect. Sometimes increasing this value is necessary to correct the motion of a body.

If you want to include an object in a scene and are only interested in the body's own motion you can ignore collisions for the body by selecting Disable All Collisions from the Properties rollout.

Deforming Meshes
When animating characters, a common approach is to use a modifier that applies a skin-and-bones to the character. A Skin modifier deforms a mesh according to the movement of its component parts (the bones). The skin mesh wraps around the bones. So, in animating a character, you actually animate the bones, and the skin merely follows the shape that the bones dictate. Bones are usually simplified since they are not actually displayed. They merely dictate motion. From a reactor point of view, skins are part of a larger subset of object types called Deforming Meshes. A deforming mesh is any body whose position, orientation and shape are all completely controlled by 3ds max. You define motion and deformation in 3ds max, but want to use that completely scripted motion to affect other bodies. You can add deforming meshes as parts of a deforming mesh collection. You can create a deforming mesh collection using the DMCollection button in the reactor menu, much like any other collection. They are physically simulated as part of their collections, and can thus affect other physical bodies, but still have their shapes and positions completely controlled by 3ds max, and are not themselves affected by the physics.

Keyframe Reduction

63

Deforming Mesh Properties


The following is a list of the properties specific to deforming meshes.
Updates/FrameThis parameter allows you to specify how often reactor asks 3ds max for the

You can use any of the following options to reduce keyframe animations in a scene. The Reduce Keyframes button in the Properties rollout reduces keyframes for selected rigid bodies. The Delete Keyframes button in the Properties menu deletes all the keyframes for selected rigid bodies. The Start/End Frame options in the Simulation rollout ensure that any reduction or deletion you want to perform only occurs between the intervals you specify. The Reduce Now button in the Advanced rollout reduces keyframes for all the rigid bodies in a simulation. The Reduce After Simulation option in the Advanced rollout ensures that when you run simulations, keyframe reduction occurs automatically. The Delete Now button in the Advanced rollout deletes all the keyframes for selected rigid bodies in a simulation.

position of the object. Higher values are more accurate, but they take a longer time to simulate. Low values can result in inaccurate simulation.
FreezeThe Freeze check box disables

updates of any objects in the collection. In so doing, you set the objects to behave as fixed rigid bodies. This is useful for situations in which you want other objects to settle on top of the deformed mesh before an animation begins.

Keyframe Reduction
When composing animations, it is common for many of the keyframes to be relatively redundant. However, these redundant keyframes are still factored into the creation process, which can result in large uses of memory and disk space. It is for this reason that reactor includes a feature called keyframe reduction. Keyframe reduction enables you to assign specific keyframes to objects. For example, you can tell a rigid body its positions in a couple of frames (perhaps frame 0, frame 25 and frame 90), and 3ds max interpolates the frames in between the ones you have specified. This affords you a high level of control, while also considerably reducing system resource usage.

64

Chapter 10: Animation

Interactive Modification
Quite often, the scene you will want to work with is not the one you designed in 3ds max. You may have designed a scene with the objects above the ground, but want them in their natural rest position. You may also want to reflect other physical changes such as folds in draping curtains. You can use the Update Max function to translate physical changes in the simulation back to 3ds max. When running a simulation in a window, wait until the objects in the scene have attained the states that you want to translate back to 3ds max, open the Max menu and select Update Max (see Figure 10.7.1).

Figure 10.7.1

When you close the preview window and click one of the view panes, the scene is updated. No update of 3ds max can be done until the preview window is closed. In addition, the Use Max Parameters option resets the simulation window to use the timestep and substeps specified in the Animation rollout, and the total Animation Time specified by 3ds max.

Introduction
This section discusses the use of MAXScript with the reactor plug-in. It assumes a basic working knowledge of the scripting language. You can access full information on MAXScript in MAXScript Reference option of the Help menu. You can enter sections of script into the 3ds max built-in listener for testing and experimentation. To start the MAXScript Listener, press F11. Alternatively, you or use the MAXScript Listener option from the MAXScript menu. (See Figure 11.1.)

reactor Objects
You can create many of the objects available with the reactor plug-in through MAXScript. You can also access many of the properties from the rollouts through scripting. You can display accessible reactor objects using the following MAXScript commands:
apropos "HK*" apropos "Havok*"

At time of writing these commands display the following lists of objects:


apropos "Havok*" HavokSetGravity (const Primitive): HavokSetGravity() HavokGetGravity (const Primitive): HavokGetGravity() HavokDeleteAllKeys (const Primitive): HavokDeleteAllKeys() HavokReduceAllKeys (const Primitive): HavokReduceAllKeys() HavokReduceSelectedKeys (const Primitive): apropos "HK*" HKWaterWSM (const MaxClass): Havok_Water HKRBCollection (const MaxClass): RBCollection HKConstraintSolver (const MaxClass): CSolver

Figure 11.1

66

Chapter 11: MAXScript and reactor

HKPointToNail (const MaxClass): Point_Nail HKPointToPath (const MaxClass): Point_Path HKPointToPoint (const MaxClass): Point_Point HKDMCollection (const MaxClass): DMCollection HKMotor (const MaxClass): Motorhelper HKCLCollection (const MaxClass): CLCollection HKWind (const MaxClass): Windhelper HKToyCar (const MaxClass): Toy_Car HKSBCollection (const MaxClass): SBCollection HKRPCollection (const MaxClass): RPCollection HKPlane (const MaxClass): Planehelper HKSpring (const MaxClass): Springhelper HKFracture (const MaxClass): Fracture HKDashpot (const MaxClass): Dashpot HKClothModifier (const MaxClass): Havok_Cloth HKWaterWSMObject (const MaxClass): Water HKSoftBodyModifier (const MaxClass): Havok_SoftBody HKRopeModifier (const MaxClass): Havok_Rope HKAttachToRBModifier (const MaxClass): Havok_AttachToRB HKDynamics (const MaxClass): Havok_Dynamics OK HavokReduceSelectedKeys() HavokDeleteSelectedKeys (const Primitive): HavokDeleteSelectedKeys() HavokTestSelectedConvexity (const Primitive): HavokTestSelectedConvexity() HavokExportWorld (const Primitive): HavokExportWorld() HavokAnalyzeWorld (const Primitive): HavokAnalyzeWorld()

HavokPerformSimulation (const Primitive): HavokPerformSimulation() HavokShowInWindow (const Primitive): HavokShowInWindow() HavokSetDirectX (const Primitive): HavokSetDirectX() HavokGetDirectX (const Primitive): HavokGetDirectX() HavokSetFullScreen (const Primitive): HavokSetFullScreen() HavokGetFullScreen (const Primitive): HavokGetFullScreen() HavokSetMSDamping (const Primitive): HavokSetMSDamping() HavokGetMSDamping (const Primitive): HavokGetMSDamping() HavokSetMSRestLength (const Primitive): HavokSetMSRestLength() HavokGetMSRestLength (const Primitive): HavokGetMSRestLength() HavokSetMSStrength (const Primitive): HavokSetMSStrength() HavokGetMSStrength (const Primitive): HavokGetMSStrength() HavokSetTextureQuality (const Primitive): HavokSetTextureQuality() HavokGetTextureQuality (const Primitive): HavokGetTextureQuality() HavokSetCastShadowsPlane (const Primitive): HavokSetCastShadowsPlane() HavokGetCastShadowsPlane (const Primitive): HavokGetCastShadowsPlane() HavokSetCastShadowsCheck (const Primitive): HavokSetCastShadowsCheck() HavokGetCastShadowsCheck (const Primitive): HavokGetCastShadowsCheck() HavokRemoveLight (const Primitive): HavokRemoveLight() HavokAddLight (const Primitive): HavokAddLight() HavokSetCamera (const Primitive): HavokSetCamera() HavokGetCamera (const Primitive): HavokGetCamera()

reactor Objects

67

HavokCheckRigidRigidCollisions (const Primitive): HavokCheckRigidRigidCollisions() HavokEnableAllCollisions (const Primitive): HavokEnableAllCollisions() HavokEnableAllRigidCollisions (const Primitive): HavokEnableAllRigidCollisions() HavokEnableRigidRigidCollisions (const Primitive): HavokEnableRigidRigidCollisions() HavokDisableAllRigidCollisions (const Primitive): HavokDisableAllRigidCollisions() HavokDisableRigidRigidCollisions (const Primitive): HavokDisableRigidRigidCollisions() HavokSetExportDisplay (const Primitive): HavokSetExportDisplay() HavokGetExportDisplay (const Primitive): HavokGetExportDisplay() HavokSetExportFormat (const Primitive): HavokSetExportFormat() HavokGetExportFormat (const Primitive): HavokGetExportFormat() HavokSetUpdateViewports (const Primitive): HavokSetUpdateViewports() HavokGetUpdateViewports (const Primitive): HavokGetUpdateViewports() HavokSetTimeScale (const Primitive): HavokSetTimeScale() HavokGetTimeScale (const Primitive): HavokGetTimeScale() HavokSetSubsteps (const Primitive): HavokSetSubsteps() HavokGetSubsteps (const Primitive): HavokGetSubsteps() HavokSetFramesKey (const Primitive): HavokSetFramesKey() HavokGetFramesKey (const Primitive): HavokGetFramesKey() HavokSetEndFrame (const Primitive): HavokSetEndFrame()

HavokGetEndFrame (const Primitive): HavokGetEndFrame() HavokSetStartFrame (const Primitive): HavokSetStartFrame() HavokGetStartFrame (const Primitive): HavokGetStartFrame() HavokSetReduceAfterSimulation (const Primitive): HavokSetReduceAfterSimulation() HavokGetReduceAfterSimulation (const Primitive): HavokGetReduceAfterSimulation() HavokSetReductionThreshold (const Primitive): HavokSetReductionThreshold() HavokGetReductionThreshold (const Primitive): HavokGetReductionThreshold() HavokSetAnalyzeBeforeSimulation (const Primitive): HavokSetAnalyzeBeforeSimulation() HavokGetAnalyzeBeforeSimulation (const Primitive): HavokGetAnalyzeBeforeSimulation() HavokSetSaveBeforeSimulation (const Primitive): HavokSetSaveBeforeSimulation() HavokGetSaveBeforeSimulation (const Primitive): HavokGetSaveBeforeSimulation() HavokSetWorldScale (const Primitive): HavokSetWorldScale() HavokGetWorldScale (const Primitive): HavokGetWorldScale() HavokSetCollisionTolerance (const Primitive): HavokSetCollisionTolerance() HavokGetCollisionTolerance (const Primitive): HavokGetCollisionTolerance() HavokSetResolver (const Primitive): HavokSetResolver() HavokGetResolver (const Primitive): HavokGetResolver() HavokSetUnyieldUpdates (const Primitive): HavokSetUnyieldUpdates() HavokGetUnyieldUpdates (const Primitive): HavokGetUnyieldUpdates() HavokSetAngularDrag (const Primitive): HavokSetAngularDrag()

68

Chapter 11: MAXScript and reactor

HavokGetAngularDrag (const Primitive): HavokGetAngularDrag() HavokSetLinearDrag (const Primitive): HavokSetLinearDrag() HavokGetLinearDrag (const Primitive): HavokGetLinearDrag() HavokSetAddDragAction (const Primitive): HavokSetAddDragAction() HavokGetAddDragAction (const Primitive): HavokGetAddDragAction() OK

You can view properties specific to any of the reactor objects with the MAXScript command showProperties, followed by any variable. Using the previously created rigid body collection, typing showProperties rbc displays the following:
.rigidBodiesTab (Rigid_Bodies_Tab) : node array .showText (Show_Text) : boolean .iconSize (Icon_Size) : float .displayType (Display_Type) : integer .odeSolver (ODE_Solver) : integer .refreshRate (Refresh_Rate) : float .addDeactivator (Add_Deactivator) : integer .energy : float .time : float .samples : integer

Typing any of the commands from the HK* list followed by a set of brackets creates a new object. For example, to create a new rigid body collection, type HKRBCollection() into the listener. This new object is always placed at the scene origin [0, 0, 0] and can be moved with the standard MAXScript commands, such as
rbc = HKRBCollection() rbc.position = [10, 10, 10]

The commands from the Havok* list return or require parameters. They relate to the elements from the reactor utility, and allow you to set and check parameters. This is true for all of the above except those relating to collisions, such as HavokEnableRigidRigidCollisions - which takes the name of a rigid body collection and the two rigid bodies between which you want to enable collisions.

These properties generally relate directly to items on that object's Modifier rollout. For example, instead of using the Pick, Add or Delete buttons on the rigid body list in the user interface, a script may alter the rigidBodiesTab node array property as with any other MAXScript array.
rbca = rbc.rigidBodiesTab rbca[1+rbca.count] = $

This short section of script assigns a variable, rbca, to the collections rigid body array and adds the currently selected object to the end of it.

Setting Physical Properties

69

Setting Physical Properties


reactor objects have properties pertaining specifically to the reactor physics engine. These properties are assigned to any 3ds max object as user-defined properties. You can use the following MAXScript function to set the initial physical properties of any object. Thereafter, you can use the MAXScript commands setUserProp and getUserProp to access and change individual properties.
function setHKProperties o \ mass:1.000000\ elasticity:0.300000\ friction:0.300000\ optimizationLevel:0.500000\ unyielding:0\ simulationGeometry:2\ proxyGeometry:"<None>"\ useDisplayProxy:0\ disableCollisions:0\ inactive:0\ displayProxy:"<None>" = ( if not undefined == o then

Running the Simulation


You can start the reactor simulation using MAXScript by calling the function HavokPerformSimulation(). See the macro script relating to the reactor toolbar for further available functions. This macro script file is called reactor.mcr and can be found in the ui/macroscripts subfolder of 3ds max program folder.

Example Scripts
The following scripts have been included in this manual as useful examples of how to use MAXScript. The first script displays the basic physical properties of mass, elasticity and friction in a floating toolbar. This shows how you can set properties without having to go to the main reactor utility.
rollout HKProperties "Properties" ( local bUpdate = true group "Physical Properties" ( spinner mass "Mass" range:[0,1000000,0] scale:0.01 fieldwidth:75 spinner elasticity "Elasticity" range:[0,1,0.3] scale:0.01 fieldwidth:75 spinner friction "Friction" range:[0,1,0.3] scale:0.01 fieldwidth:75 ) function enableAll = ( mass.enabled = true elasticity.enabled = true friction.enabled = true ) function disableAll = ( mass.enabled = false elasticity.enabled = false friction.enabled = false )

(
setUserProp o "Mass" mass setUserProp o "Ellasticity" elasticity setUserProp o "Friction" friction setUserProp o "Optimization_Level" optimizationLevel setUserProp o "Unyielding" unyielding setUserProp o "Simulation_Geometry" simulationGeometry setUserProp o "Proxy_Geometry" proxyGeometry setUserProp o "Use_Display_Proxy" useDisplayProxy setUserProp o "Disable_Collisions" disableCollisions setUserProp o "Inactive" inactive setUserProp o "Display_Proxy" displayProxy )--if )

70

Chapter 11: MAXScript and reactor

function updateProperties = ( if bUpdate then ( for o in selection do ( setUserPropo "Mass" mass.value setUserPropo "Ellasticity" elasticity.value setUserPropo "Friction" friction.value )--for )--if ) function updateRollout = ( if 0 == selection.count then ( disableAll() return false )--if mass.value = 0 elasticity.value = 0 friction.value = 0 for o in selection do ( if not isKindOf o GeometryClass then ( disableAll() return false )--if if (undefined == (getUserProp o "Mass")) or (undefined == (getUserProp o "Ellasticity")) or (undefined == (getUserProp o "Friction")) then ( setHKProperties o )--if bUpdate = false mass.value += getUserProp o "Mass" elasticity.value += getUserProp o "Ellasticity" friction.value += getUserProp o "Friction" bUpdate = true )--for mass.value /= selection.count

elasticity.value /= selection.count friction.value /= selection.count enableAll() ) on mass changed value do updateProperties() on elasticity changed value do updateProperties() on friction changed value do updateProperties() on HKProperties open do updateRollout() ) if undefined != HKDynamicsFloater then closeRolloutFloater HKDynamicsFloater HKDynamicsFloater = newRolloutFloater "reactor" 190 300 addRollout HKProperties HKDynamicsFloater callbacks.removeScripts #selectionSetChanged id:#Havok callbacks.addScript #selectionSetChanged "HKProperties.updateRollout()" id:#Havok

Setting Physical Properties

71

The following script converts a 3ds max IK chain into a reactor constraint tree.
--tau - strength of constraints --twoway- whether to create bi-directional constraints --N.B. leaf objects of chain are --automatically linked two-way -- ga - grouping array global tau = 15.0 global twoway = false global ga = #() function createPointPoint o1 o2 p = ( pp = Point_Point() pp.name = o1.name + o2.name + "P2P" pp.rigidBodyA = o1 pp.rigidBodyB = o2 pp.point = p pp.tau = tau pp.position = (o1.position + o2.position) / 2 return pp ) -- __MaxIK2reactorKConstraint -- parameters: --rbc- rigid body collection --cs - constraint solver --o - head of IK chain -function __MaxIK2reactorConstraint rbc cs o = ( rbca = rbc.rigidBodiesTab rbca[1+rbca.count] = o if undefined == getUserProp o "Mass" then setHKProperties o -- end of chain if 0 == o.children.count then return false csa = cs.constraintsTab for c in o.children do (

p = Point() p.position = (o.position + c.position) / 2 append ga p pp = createPointPoint o c p csa[1+csa.count] = pp __MaxIK2HavokConstraint rbc cs c if twoway then ( p.position = ((o.position*1) + (c.position*2)) / 3 p = Point() p.position = ((o.position*2) + (c.position*1)) / 3 append ga p pp.position -= [1, 1, 1] pp = createPointPoint c o p csa[1+csa.count] = pp pp.position += [1, 1, 1] ) ) return true ) mapped function MaxIK2HavokConstraint o = ( if (undefined == o) or (0 == o.children.count) then ( --messageBox "Select the head of an linked object chain" return false ) ga = #() rbc = RBCollection() rbc.name = o.name + "RBCollection" move rbc (o.position - [5, 5, 5]) cs = CSolver() cs.name = o.name + "CSolver" cs.rbCollectionNode = rbc move cs (o.position + [5, 5, 5]) __MaxIK2HavokConstraint rbc cs o join ga #( cs, rbc )

72

Chapter 11: MAXScript and reactor

join ga cs.constraintsTab g = group ga g.name = o.name + "ConstraintGroup" setGroupOpen g true ) -- * after using this utility make sure that all the bodies in the -collection have the collisions with each other disabled. -- * see advanced tab in RBCollection -- * also add new RBCollection and CSolver to simulation utility HKConstrainIK "Constrain IK Chain with Points" ( button bConstrain "Constrain" checkbox cbTwoway "two-way" spinner sTau "strength:" range:[0,1000,15] on bConstrain pressed do ( if 0 == selection.count then ( messageBox "Select someting!" ) else ( tau = sTau.value twoway = cbTwoway.checked undo on ( MaxIK2HavokConstraint selection ) ) ) )

Running Scripts
Once you have written MAXScripts, they are generally saved in text files with a .ms extension in the Scripts subdirectory. You can then access these scripts through the MAXScript utility rollout. To do this, you open the Utility panel and click the MAXScript utility button. Using the Run button, try selecting the HKPropertiesFloater.ms script file. You can now alter the basic rigid body properties in this dialog box rather than the reactor utility rollout. Running the second sample script in the file HKConstrainIKwithPoints.ms adds an item into the MAXScript utilities list. In the Scenes folder in the reactor directory, there are two files associated with this tutorial. They show how your scene should appear at the start and at the end of the tutorial. They are called TutorialScriptStart.max and TutorialScriptEnd.max.

Running Scripts

73

The first scene contains a chain of spheres model, linked hierarchically using the standard 3ds max format.

5. Select the small sphere. This is the overall

parent object.

Figures 11.5.2 and 11.5.3

6. In the Constrain IK Chain with Points


Figure 11.5.1

To create a constrained chain of spheres from a 3ds max hierarchy:


1. Create a scene with six spheres arranged

vertically above each other. The topmost sphere should be smaller than the others and positioned much higher over them.
2. Create a flat surface onto which the

utility rollout, set the constraint strength to a value somewhere between 50 and 100 and click the Constrain button. This creates a grouped object that contains a number of point-to-point constraints, a constraint solver and a rigid body collection.
7. Select RBCollection01 and disable it. The

spheres can fall during simulation.


3. Create a link hierarchy whereby each

newly created rigid body collection already contains the spheres and an error appears if they are duplicated.
8. Run the simulation again. This time the

sphere is linked to the sphere above it. Note that only the large spheres should have a mass and all objects have their Display Children option disabled in the Properties panel, so children are not displayed more than once. If you dont want to create the scene you can load TutorialScriptStart.max
4. Run the simulation and watch as the

spheres hang on a chain from the topmost sphere, constrained together by point-topoint constraints. See Figure 11.5.3.

spheres collapse on each other. See Figure 11.5.2.

74

Chapter 11: MAXScript and reactor

World Scale
You can use 3ds max to model a wide range of objects. You can also use different units, as meters, inches, or 3ds max generic units. From the visual point of view the scale and units you use make no difference. However, the physical representation of your objects depends on the units used. The units determine the objects' size in the physical world. The plug-in function, Analyze World, will give you warnings if it detects that you are using extremely strange values (gravity very high, objects very big but with small mass, etc.). However a good understanding of how to use different units and scales in the plug-in will decrease your effort, and help you design accurate simulations more quickly. This is the aim of this section.

World Scale
In order to create proper simulations, the reactor plug-in must know the correspondence between your units and realworld measurements. You can set this correspondence using the World Scale option in the Advanced rollout (Figure 12.1.1). You can design your scenes to any scale, using any units you want. By setting the ratio between 1 unit in the 3ds max world and 1 meter in the physical world, you can easily control the size of your objects in the physical simulation. For example, if you designed a scene in meters with objects twice the size that you want for simulation, then you could then set World Scale to 1m = 2.0m.

76

Chapter 12: World Scale

another process, called collision resolution to react by applying forces to the objects involved and bouncing them away from each other. In general, the higher the value of the collision tolerance, the more stable the simulation will be. However, setting too high a value for collision tolerance could lead to a noticeable gap between objects. You need to strike a balance between stability and visual effect. There is another variable in the equation that also affects the overall stability of the system. The number of substeps taken during every simulation step can counteract the effects of a small tolerance. So it is recommended to set the collision tolerance to the highest value at which it does not visually affect the scene. If this appears unacceptable during simulation due to unstable object collisions, increase the number of substeps in the simulation. For instance, if your scene consists of many objects in a room, a tolerance around 0.1m should be fine. However, if the objects in your scene are dice on a table a smaller tolerance, say 0.01m or less, is preferable. If your objects are cars or buildings, a higher tolerance applies. Collision tolerance is measured in user units. That means that the world scale affects its actual value.

Figure 12.1.1

If you design a scene in inches at real size, then set 1m=39.37. Be aware that any linear values in the scene such as gravity, or rest length of springs, are interpreted using your units. That means that gravity in your "double size world" should be 19.62 m/s2 (i.e. twice the normal gravity of 9.81 m/s2).

Collision Tolerance
One of the processes during dynamics simulation is called collision detection. This means the detection of when two objects are colliding in the scene. A global value, the collision tolerance, specifies the minimum safe distance between two objects. If they are closer than this safe distance allows, they are considered to be colliding. This allows

Collision Tolerance

Advanced Simulation Options


This chapter covers all of the Advanced rollout options.

The collision tolerance determines how close objects may approach before they are considered to have collided. See page 76 for details.

Add Drag Action


Adding a drag action to the system ensures that rigid bodies are subject to constant drag. This damps their linear and angular velocities, so they come to rest sooner. For example, it is highly desirable to introduce drag whenever constraints join rigid bodies, since otherwise the constraint system may never come to rest if perturbed. The parameters Lin and Ang determine the linear and angular damping applied, respectively. A drag action does not apply to entities other than rigid bodies.

Resolver
reactor allows you to choose the method of collision resolution (see page 76) using one of four resolvers: Nave, No Friction, Simple Friction or Complex Friction.
NaveReverses velocities of approaching objects. This is very fast, but very inaccurate. No FrictionPerforms proper Newtonian

resolution using the coefficients of restitution, but ignores all friction values for objects in the scene. Objects tend to slide across each other.
Simple or Complex FrictionPerforms proper Newtonian resolution using the coefficients of restitution and simple and complex models of friction respectively. Simple is less computationally expensive, but less accurate.

Unyielding Bodies
Alters interpolation properties of keyframed bodies. See page 62.

78

Chapter 13: Advanced Simulation Properties

You will probably not need to alter the resolver from complex friction unless you wish to trade accuracy for speed.

World Scale
This controls how units in 3ds max are interpreted as real-world measurements during simulation. It defines the scale of your physical objects.

Save Before Simulation


Check this box if you want 3ds max to try and save your scene every time you perform a simulation.

World Analysis
The Analyze World button allows you to test the scene for any suspicious or odd parameters or configurations. You can check the Analyze before simulation check box if you want to perform the Analyze World test every time you perform a simulation. The default is that this test should be performed.

Key Management
This section allows you to reduce duplicate or similar keyframes while retaining a visually identical animation.

Introduction
Welcome to the Havok physics primer. This document is designed to give a broad overview of physical simulation and specific details about how Havok technology performs these simulations. We will not refer to particular Havok products, but rather aim to give a general understanding of the terminology, methodology and behavior associated with the Havok physics engine.

terms of the CPU resources required - they are concerned with accuracy and as such the calculations need to be performed with a high level of detail. Both methods employ some form of grid which breaks up the object / scene being simulated into chunks or elements (see Figure 1) and performs calculations at the element level (therefore the greater the number of elements the more accurate the simulation, but the more calculations required.)

Physical Simulation
Physical simulation is certainly not a new phenomenon. Computers have been used to simulate ballistic motion (i.e. rocket trajectories for military purposes) since the second world war; one of the world's first computers, Collossus, was built primarily for this purpose. Finite element (FE) and computational fluid dynamics (CFD) methods have been employed for decades to aid in industrial design, to simulate anything from vehicle crash test performance to airflow over semiconductors. These last two methods are typically very expensive in

Figure 1: A finite element based temperature simulation, with an individual element shown.

80

Appendix

Most of these high-end simulations employ some form of boundary condition, or information regarding the bounds of the simulation in order to take into account the rest of the scene around the object being simulated. For example, we might want to examine the result of an impact on the side wing of a car. Rather than model the entire car, we model only the wing itself and set up boundary conditions that capture the fact that the wing is actually attached to other semi-rigid parts of the car - the wing is simulated in isolation (simply because of the expense of simulating the whole car at the level of accuracy required.) In effect we are not interested in the entire scene or system (i.e. the car) but only in the object itself (the wing) and are prepared to make large assumptions about the rest of the scene in order to get good accuracy for the object simulation. At another level we might want to see how interacting entities behave to give system wide behavior - this is discrete event simulation where the aggregate behavior of a system of events over a period of time is of interest. For example, you might construct a discrete event simulation of a bank teller (see Figure 2) and the length of queue that forms based on certain conditions (average time spent by customer, speed of bank teller etc.)

Figure 2: Discrete event simulation of a bank teller and customers

The Continuum of Simulation


It's of no interest in this case whether the individual customers bang into each other, or trip over the queue guide ropes - we are only interested in figuring out the average length of the queue and the average throughput of the bank. We talk of averages here, because we're dealing with statistical behavior rather than individual behavior (with a good model with good assumptions we can predict the wait time for a customer within a statistic margin of error, but would never be able to predict exactly what would happen to the customer; who they would meet in the bank or whether they would slip on a banana skin.)

Appendix

81

This leads us to a sort of continuum of physical simulation; at one end we have the highly accurate but highly localized finite element based simulation and at the other we have discrete event simulation, where the behavior of individual entities is not of interest, but rather the behavior of the system as a whole. Havok physics simulation is somewhere in the middle of these; we are not really concerned with the specific and accurate behavior of an object or sub-part of an assembly although we do want to know how each object interacts and behaves (but we might not be interested in the pressure at a particular point inside the object or the heat distribution through the object). At the other end of the spectrum, we're not really looking for aggregate system-wide behavior without caring about the behavior of the individual elements - it's these elements that we're interested in! With Havok, the entire scene is modeled; we are interested in the behaviors of collections of physical objects of various shapes and substances with a view to creating immersive and interesting environments.

Realism vs. Believability


Havok's core aim is to provide a simulation that appears realistic. In many cases we've had to make assumptions and take short cuts in order to simulate the scene in as fast a time as possible - but these short cuts have always attempted to trade off accuracy and not believability. One of our allies in this is chaos. The world around us is inherently chaotic we're all familiar with the butterfly effect (a butterfly in Canada flaps its wings and causes, by an unlikely chain of events, a typhoon in India). In the case of physics simulation, we are dealing with such a large number of parameters (positions, orientations, forces, velocities etc.) for a large number of objects that even the slightest change in starting condition can yield enormous differences in the resulting simulation. This is mostly the reason why animation of physical systems (like clothing, wind, smashing objects) rarely looks realistic unless a) the animator is particularly skilled and has lots of time on his hands and b) a different animation is used each time the effect is required. In Figure 3 below, a wall is struck from three different locations. If, in a game, a single animation were used each time, the impact position would have no effect on the destruction sequence, giving unrealistic and unbelievable behavior.

82

Appendix

An enormous amount of time is dedicated to mimicking chaos in animation playback, particularly for real-time systems where the animations may be played many times (we are very unforgiving of looped or repeated animations.) In a game, if a character falls in exactly the same way each time it is killed, our belief that we are playing in a real environment (albeit as fantastical as the game scenario dictates) is negatively affected. With a physics engine, you get this expected chaotic behavior by default and this is the primary reason for using this technology.

Scale
Physics, as a body of knowledge, is enormous. What we are concerned with here would more accurately be described as a mechanical simulation of the interactions of objects at real world scales. We are dealing with Newtonian mechanics, that is, the well understood laws of motion, popularized by Sir Isaac Newton, that describe the behavior of objects under the influences of other objects and external forces. Since then we've discovered that these laws break down at really small (i.e. subatomic) and really large (i.e. planetary) scales.

Figure 3: Chaotic behavior of a smashing wall impacted at different locations

Appendix

83

Table 1: Calculating the speed of an object falling under gravity

Time Elapsed 0 seconds Figure 4: Havok operates at a "real world" scale and is inappropriate for both sub-atomic and galactic / planetary scales! 1seconds 2 seconds 3 seconds 4 seconds

Speed 0 m/s 10 m/s 20 m/s 30 m/s 40 m/s

Distance Travelled 0 meters 5 meters 20 meters 45 meters 80 meters

Acceleration 10 m/s2 10 m/s2 10 m/s2 10 m/s2 10 m/s2

New physics systems have been devised to work with these scales (e.g. relativistic and quantum), but these are way beyond the scope of the Havok physics engine. As indicated in Figure 4, Havok works at the scale of objects we interact with on a daily basis (chairs, cars, buildings, footballs). By default the Havok engine works in units of meters and kilograms. One of the most common mistakes we see people make is to start by creating a box 100x100x100 units (meters remember) and wondering why it takes so long to fall. A box of this size (basically an aircraft hangar) when viewed at a distance sufficient to be able to see the entire box (say 1km away) will appear to fall at the same speed as an aircraft hangar dropped from a height and viewed 1 kilometer away. Slowly. Look at it this way: gravity at the Earth's surface is approximately 10 meters per second per second, written 10 m/s2. Therefore for every second, objects increase their speed by 10 meters per second, or 10 m/s. So we have the following speed progression:

How was this calculated? At the very start the object is stationary, and therefore its speed is 0 m/s. After a period of 1 second, accelerating at a constant 10m/s2 it will have reached a speed of 10 m/s. But, its average speed over that period was 5 m/s (i.e. start speed = 0 and end speed = 10). Therefore the distance traveled during the 1-second interval was 5m. In fact the true formula for distance traveled d given acceleration a and starting speed v after time t has elapsed is: d = vt + at2 and if t =1 second then d = v + a So you can see that even after 4 seconds has elapsed the large box (aircraft hangar) has not even fallen a distance equal to its own height, so will appear to be moving slowly. It is very important to maintain a sense of scale at all times when working with the physics engine. Changing Scale In the previous section it was stated that the Havok engine works at a scale of meters (and kilograms for weight measurements). This is not strictly accurate! In fact, Havok does not care what the units used are, it only cares about the numbers. You just need to be very careful to be consistent. So if working in meters then make sure that gravity is set to a value that is in meters (if you want Earth-like gravity then use 9.8 m/s2).

84

Appendix

If you prefer to work with inches, then you need to be aware that ALL quantities specified must be in inches. So for example, if you create a cube of size 100 units (as in the previous example), but don't specify gravity in inches, the cube will still fall at the same speed (even though you now think of it as being about 7 feet in length on each side). If gravity is set to 9.8 units, the physics engine will be effectively simulating a gravitational pull of 9.8 inches per second per second (less even than the moon!). Look at it this way:
1. Cube is 100x100x100 meters, gravity is 9.8

objects larger than sugar cubes and smaller than football fields. It is for this reason that we say the physics engine works with meter scales by default. Try to be very careful with scale, particularly when using 3D modelers. Often modelers will have their own mechanisms for displaying units in dialog boxes (e.g. 3ds max allows you to specify the units being used and automatically converts all values displayed to those units - however internally it always works in inches, including when exporting geometry.)

m/s2, cube falls slowly.

2. You switch to thinking in inches, cube is

What Does a Physics Engine Do?


A physics engine like Havok has 3 basic tasks to perform:
1. Collision detection: Track the movements

now 100x100x100 inches, but nothing has actually changed, because gravity is now 9.8 inches/s2
3. You convert gravity to inches: gravity set

to 386 inches/s2. Now the cube falls at the expected speed [1 inch = 0.0254 meters; gravity = 9.8 / 0.0254 = 386 inches/s2]

of all the objects in the scene and detect when any of them have collided.
2. Update system: Determine an appropriate

It is all relative: the physics engine works with dimensionless units at all times (does not care whether it is inches, meters or miles). It is up to you to remain consistent and convert values to the correct units as appropriate. To confuse matters though, the Havok engine has been designed to be most accurate when dealing with numbers as close in magnitude to 1 as possible (i.e. values like 10000000 are bad as are values like 0.0000001). Therefore for real world scenes when creating objects of 1x1x1 size it is more useful to be working in meters than centimeters or kilometers (or inches / miles) in that you will most often be simulating

response for objects that have collided by resolving the collision according to the object properties and for all other (noncolliding) objects update them according to the forces acting on them.
3. Interface with display: Once the new

positions of all objects have been determined we usually need to display them to the physics engine will report the updates to the 3D display system.
Note: A physics engine knows and cares nothing about how the objects it is simulating are displayed. It simulates the motion and interaction of these objects based on a physical (not graphical) description of the objects, and this information may be used to generate a display that "tracks" the simulation. This

Appendix

85

will be covered in a little more detail later in the section covering proxy objects. Given that we are talking about simulating a continuously evolving state (i.e. objects are moving and colliding and reacting all the time in general) we need to map this to a series of snap shots in order to generate an animation for display. Typically for games we are interested in knowing the state of the world 60 times a second (this is how frequently many graphics systems redraw the screen). For movies we might be interested in 25 frames per second. What this really means is that the physics engine must be capable of evolving the world by 1/60th of a second (or 1/25th of a second for movies) knowing the state of all the objects at the start of this time interval and knowing the external forces acting on these objects. As an example we'll look at the simple case of a cannon ball and we'll assume we're interested in animation at 60Hz (Hz = cycles or frames per second). Simulating a Cannon Ball Let's forget about collisions for now, and consider only the simulation of a cannon ball immediately after it has been fired from the cannon. We know the ball's position (and orientation, but we'll ignore this for now), its speed and acceleration, we know its weight and we assume we know the state of the environment (i.e. air resistance, wind force, gravity). Armed with this knowledge we can start to make predictions using Havok.

Figure 5: Expected ballistic motion of a cannon ball is a parabolic arc

Figure 5 illustrates what we would like to achieve. Over a period of time the cannon ball's rate of ascent should slow due to gravity, and it should eventually fall to the ground having traveled through a classic parabolic arc (assuming no air resistance).

Figure 6: Given an initial condition and knowing the forces acting we can estimate the new state of a body in motion

86

Appendix

At a given point in time we can examine the state of the ball (its speed v and acceleration a) and knowing the external forces acting on it we can make a guess as to its change in position after a period of time has elapsed (call this period h seconds), as shown in Figure 6. This guess is a combination of a number of factors:
1. We assume that Newton's laws of motion

Time Steps In general, the forces acting on an object are rarely truly constant (gravity is pretty close to being constant all the time but most other forces like wind, air resistance etc. are not). So taking the cannon ball example, imagine there was a windy layer in the atmosphere that the cannon ball passes through as shown in Figure 7. In the following simulation we assume we're taking steps of 1 second (which is really pretty big for a physics simulation, but used here to illustrate the point). We know all the forces acting on the ball at time t1 so we use some math to predict the new position and velocity at time t2 after 1 second has elapsed. During this period we will have assumed that the wind force acting on the ball was constant. In this example, we'll calculate the new position, which will be at a height above the region of high wind (so we'll effectively have missed the windy bit by taking too large a jump). In the second example on the right, we're using time steps of s econds. In this case after determining the new position at time t2 we find the ball in the middle of the windy region. This region causes a large wind force to act on the ball which will be taken into account during the next time step, at which point we re-evaluate the math and determine a new position for the ball at time t3 which is different from the position determined in the simulation on the left (i.e. the wind has blown the ball to the left a bit and has reduced the velocity of the ball), even though the same amount of time has been simulated in each case.

govern the motion of the ball.


2. We assume that in the time period h all the

external forces acting on the ball are constant (so air resistance, wind and gravity do not change during this time.)
3. We assume that the math we use to

calculate the new position is accurate. In general the first assumption is usually a good one (except at relativistic or quantum scales which we can assume should be handled by other systems). However, the second and third assumptions cause problems and are closely linked to the time period h over which we're performing the calculations. We'll now examine the effect of the size of this time period on the accuracy of the simulation.

Appendix

87

This is also true of the math. As the simulation becomes more complex the math required to calculate the new positions and velocities of objects in a simulation also becomes more complex, and as a result the guesses produced by the math give less and less accurate results.

Figure 8: Evolution of a physics system captured in a series of "snapshots"

So the principle is to take small time steps, evaluate all the forces acting on the objects, determine the new positions and velocities (and other parameters) of the objects at the end of the time steps and then start over. What we end up with is a series of snapshots of the state of the system as it evolves as shown in Figure 8.
Figure 7: Effects of differing time steps on simulation outcome, the big problem being the assumption of constant force acting on the object during the time period

Integrators As mentioned earlier, the math becomes less accurate as larger time steps are used. The physics engine implements a fast numerical integration of a series of differential equations describing the motion of objects. An integrator is an algorithm that attempts to estimate the new state of a variable or parameter (e.g. position) knowing information like the rate of change of the parameter (e.g. velocity). There are various

In general, the smaller the time step taken, the more accurate the result at the end of the time step - so if you want to step forward in time by a large time step t it is better to split this into n steps of a smaller time interval t/n.

88

Appendix

different integrators available. They vary in CPU load and accuracy of result. The following table gives an overview of the integrators provided with the Havok engine:
Table 2: integrators and their properties Integrator Euler Midpoint Runga Kutta (RK45) Back Euler CPU load low medium high medium Accuracy low medium high medium-high

detection or as a result of input from outside the simulation (here is where we would add input from a user in a real-time game e.g. the user presses the accelerate key should cause the vehicle being driven to accelerate).

As can be seen the higher the accuracy required the more CPU power required. We've found that for movie production you are better off with an accurate integrator (like RK45) and taking small time steps, but for real-time performance you should usually start with Euler, the fastest but least accurate, and only move to a more accurate integrator if you are not happy with the accuracy. Later we will talk more about integrators and in particular their effect on stability in constrained systems.

Figure 9: the structure of a physics simulation system

3. Having accumulated all the forces we

then, using the selected integrator, determine the new state of the objects (position, orientation, velocity, acceleration etc.). This information is then used to update the 3D display.
4. Advance time by the step size h and

The Simulation Loop


We'll examine now the structure of the physical simulation (shown in Figure 9) and how we integrate this with a 3D display. Having set up the initial conditions for a given scene, we begin the main simulation loop which basically steps through 3 phases:
1. Detect Collisions: at each step we need to

determine if these new positions have resulted in collisions between any of the objects. This assumes that at each step in the simulation we actually want to update the display. The next section deals with what happens when this is not the case. Substeps Assume we absolutely need to update the display once every 1/60th of a second (i.e. we are either playing a real-time game that refreshes the screen at 60Hz. or we are creating a movie to be played back at 60

determine which objects have collided. These will result in new collision forces and friction forces being introduced into the system.
2. We then update all the forces acting on the

objects either as a result of collision

Appendix

89

frames per second.) Ignoring the load on the CPU, this effectively means that we want to step the physics engine at intervals of 1/60th of a second. In many cases this does not present a problem, but if, hypothetically, the accuracy of the simulation was not sufficient (remember: smaller time steps mean better accuracy) then we'd like to decrease the time step even further, let's say to 1/120th of a second. But this would mean we generate twice the number of images we are interested in, which is wasteful. To get around this, the Havok engine allows you to specify the number of substeps to take. The substep parameter specifies the number of steps the physics engine takes before updating the 3D display. This gives control over the granularity of the physics simulation independent of the display update frequency. So if substeps = 0, then no physics steps are taken. With substeps = 1, a single simulation step is used for each update to the 3D display. With substeps = 2, 2 physics steps are taken, and then the display is updated. In Figure 10 we have specified that the physics simulation should step at intervals of 1/240th of a second, but that we only update the display once every 1/60th of a second. This has been achieved by instructing the physics engine to employ 4 substeps. Therefore for every 4 steps we update the display only once. By setting the number of substeps we can control the accuracy of the physical simulation independent of the display.

Lower Limit on CPU An unfortunate but unavoidable side effect of using a physics simulation is that there is a definite lower limit on the CPU time you can give to the physics. In contrast, there's no real lower limit on the CPU time given to graphical display (let's assume you don't have hardware acceleration). As you decrease the CPU allocation to the display you can simply draw fewer polygons, or remove fogging, or turn off lighting, but at no time will the display actually "break".

Figure 10: Substeps allow simulation frequency to be decoupled from display frequency

Physics is different. A physical simulation must be maintained at a stable state (given that each simulation result depends completely on the previous simulation step). If, in one step, we produce a very inaccurate result, then the next step is likely to be even more inaccurate, and you end up in a spiral of decreasing accuracy until eventually the results are garbage (the simulation is said to

90

Appendix

have "exploded"). Therefore you can't simply reduce the number of objects or turn off friction to compensate for a reduction in the available CPU resources - you simply have to ensure that your scene can be simulated stably even with the lowest expected CPU bandwidth. Energy Management One of the major factors determining the load on the CPU in a physical simulation is the number of objects that are active or moving i.e. being physically simulated. In a typical scene a large number of objects are not actually moving at all, and in theory could be ignored until interacted with. Energy management is concerned with determining which objects in a scene are not doing very much and removing these from the physical simulation (known as turning the object off or deactivating the object) until such time as they begin to move again. The important elements of energy management are: When should an object be turned off? When should an object be turned back on? Both questions above are tricky to provide a general answer for and typically the correct answer is highly context dependent. Usually objects are deactivated when they havent moved much recently, and are reactivated when hit by other moving objects. However, temporarily removing objects from the simulation remains the best single way to reduce the load on the CPU and it is well worth experimenting with the parameters provided by the Havok engine for automated object deactivation.

Collision Detection
This is possibly the most crucial part of any physics engine. Collision detection typically accounts for over 90% of the CPU time required for a physical simulation. Given that we are interested in large numbers of interacting objects we have a potential explosion in the number of collision tests we need to do. At a worst case, with n objects in a scene we need to guarantee that every possible pair (sometimes called a collision pair) is checked. This requires n(n - 1)/2 tests (for each object n we test with every other object but not itself, (n - 1), giving n(n - 1) tests, but given that a test for A colliding with B is the same as one for B colliding with A we divide by 2). So for 4 objects we need to do 6 tests; for 100 objects we do 4950 tests. This gets expensive pretty quickly. Given that the physics engine needs some detailed information about each collision in order to be able to resolve it correctly, the collision tests themselves are expensive. There are a number of ways to speed up this process:
1. Reduce the number of collisions that

require detailed collision results to be generated (i.e. use a simpler collision test first).
2. Reduce the complexity of the objects being

tested for collisions.


3. Reduce the number of objects.

Obviously always try to achieve the third option first. The number of objects active in a given scene is the primary source of CPU load. If objects can be removed this speeds up the simulation. In the case of the reducing complexity, the difficulty in providing

Appendix

91

detailed collision results is directly associated with the complexity of the objects themselves. We'll address this in the next section. Firstly we'll deal with how the Havok system attempts to achieve a reduction in the number of complex collisions.

a much faster operation than doing full collision testing on arbitrary shapes), and if they do, that collision pair is passed to the next, more complex pass. Out of the potential list of 6 collision pairs = { AB, AC, AD, BC, BD, CD } we find that only 2 pairs have overlapping boxes = { AB, CD } and therefore only these 2 collision pairs need further testing. This is sometimes called trivial rejection. Note that although, for example, pair AB has not been trivially rejected, this does not mean that A and B are actually colliding - only that they might be colliding. We do know, however, that A and C definitely do not collide because their bounding boxes do not overlap.

Multiphase Collision Testing


The Havok system employs a series of collision tests, each getting progressively more complex, but after each test we eliminate as many objects from the test process before moving to the next level. Assume we have a simple test A and a complex test B. Test A is very fast to run but is not very accurate (but as long as it is conservative this is not a problem - a conservative test may return TRUE i.e. there is a collision, when in fact there isn't but will never return FALSE i.e. there is no collision when in fact there is). Test B is slow to run but highly accurate. The process involves: First test all objects with test A eliminating those that definitely do not collide, but not necessarily eliminating all non-colliding pairs. Then test with test B which will take the reduced number of collision pairs and perform the complex collision test on these. As an example consider the tests shown in Figure 11. Here we see an example of the first pass of a collision system. In this case we're using bounding boxes or boxes that enclose fully the objects contained within. We test first to see if any of the boxes overlap (this is

Figure 11: First pass in a collision detection system attempting to eliminate as many collision pairs as early as possible

92

Appendix

The next phase will usually perform a more accurate rejection test or the final collision test (as shown in Figure 12) to determine information like the point of collision, the normal to the objects at the point of collision etc. which require substantially more work than simply testing for box overlaps. The good news is that you don't have to worry about all this. The Havok system automatically implements this multiphase collision detection approach and creates bounding boxes for all objects in the simulation automatically. The only control the user has over the complexity of the collision detection is in the shapes of the objects themselves. The next section deals with the various types of object shapes you can use and their complexity for collision detection.

Rigid Bodies & Collision Geometries


The shapes of the objects being tested for collisions have a major impact on the speed of the collision test. If we can make assumptions about the shape or even simplify the geometry for collision testing we can save a lot of CPU time. One of the first assumptions that physics engines make is in assuming that all the objects in the scene are perfectly rigid (i.e. can never change shape). This results in a rigid body simulation. If all bodies are rigid then we can take advantage of the fact that the geometry of the objects does not vary from step to step and we can memorize these shapes and previous collision results to speed up the next collision test we perform using those objects. This naturally means that objects made out of cloth, liquids or any deformable material cannot be simulated. Handling these sorts of object will be dealt with later.

Figure 13: Some of the geometry formats supported by Havok.

Figure 12: Multiphase collision testing

Appendix

93

Insisting that all objects are perfectly rigid in a physical simulation is actually pretty bad news for the system (except for collision detection). All colliding objects, no matter how hard, deform even if infinitesimally at the point of contact and then return to their original shape when they bounce away from the collision. When totally rigid objects collide, very large forces are generated in order to keep them apart. This is an unfortunate side effect that needs to be addressed for realistic collisions. In the Havok physics engine objects are classified according to their shape, and particular shapes have particular properties that make it easier to deal with them during collision detection. The following list classifies object shapes in order of increasing complexity (see Figure 13 for diagrams of some of these): Implicit: we have a mathematical representation of the object and base the collision test on this. Implicit objects supported by Havok include:
spheres planes polygons

from the object. If you only pass through the object's surface once, it's convex. Figure 14 depicts some rigid body simulations using entirely convex objects.
Concave: an object described by a closed

surface (no holes or strange selfintersections like Klein bottles). Concave objects are always assumed to represent volumes (i.e. the polygon mesh representing the surface has no holes or gaps in it).
Polygon Soup: a collection of polygons,

not necessarily connected, all grouped and classified as a single object. This is the most expensive format to detect collisions with, but is also the most general.

Polygonal: we have a description of the object in terms of the polygons (usually triangles) making it up. In this case we classify the objects, in order of increasing complexity, as:
Convex: imagine wrapping the object in

a cellophane wrap - if the cellophane touches every part of the surface (i.e. there are no hollows in the surface that the cellophane does not reach) then it's convex. Alternatively, pick a point inside the object and follow an imaginary ray from that point going in any direction out

Figure 14: Rigid body simulations using only convex shapes

94

Appendix

In Figure 15, the duck is shown represented as a convex object (the skin defined in the image on the bottom) and the true concave geometry on the top. Proxy Objects The good news is that even though an object in a simulation may appear complex, it need not be simulated with this complexity. For example, a car chassis displayed with detailed NURB panels and including wing mirrors and bumpers etc. might be simulated as a box. This is one of the main ways to reduce the CPU costs of a simulation. These simplified objects representing the more complex display geometry are known as proxy objects or proxy geometries. Artifacts resulting from the use of proxies may be visible and in general you should attempt to make the proxy object as close a fit to the real display geometry as possible
Figure 16: Collision proxies for a complex shape

In Figure 16 we show a series of proxy objects for a complex geometry (the gray jagged thing which we'll assume is represented as a polygon soup). You can choose any proxy geometry you like for any shape of object but it makes sense to only use a simpler proxy geometry than the actual object itself. In many cases you will actually create a specific geometry (like the last one in Figure 16) that is a combination of a sphere and a box. The final choice of proxy will represent a tradeoff between speed of collision and accuracy required and is typically very context specific. In Figure 17 the effect of the choice is plainly visible; a sofa geometry (with a pretty high polygon count) is being represented by 2 different proxies, a sphere and a collection of boxes. The collection of boxes is more expensive to compute collisions for but the sphere has a tendency to roll around, so is probably unsuitable in this case.

Figure 15: Concave and convex representations of a rubber duck

Appendix

95

Figure 17

When Havok encounters a pair of interpenetrating objects it simply ignores that collision pair and does not attempt to do anything clever - it will always try to prevent it happening in the first place of course. Interpenetrations occur most frequently in the following cases: When large forces are acting on objects forcing them to penetrate another object close by (often caused in large stacks). If the time step is too large, objects can become embedded in other objects before the physics engine has a chance to do anything about it. If the user sets the position of a physical object in such a way as to cause an interpenetration (see next sections for more details). If the collision tolerance is too small. See the next sections for more information on this. The time step used in a simulation has a large impact on the collision detection engine's ability to accurately detect collisions. If large time steps are being taken 2 things can go wrong: Figure 18 shows large time step issues in collision detection: on the left a collision is missed completely, on the right an interpenetration result.

In Figure 17, on the left we show a complex sofa object and 2 choices of proxy, on the right we show the simulation in progress (with the proxy objects displayed - although this would normally not be the case). The sphere is less suitable than the collection of boxes.

Interpenetration
Objects in a physical simulation are assumed to be solid and (except in the case of polygon soups) have a defined volume. It makes no sense in the real world to think of one solid object either inside or penetrating another solid object (it's not possible to embed a cup in a table). Similarly in the simulation of the real world, a physics engine is intolerant of objects that are interpenetrating. It also causes disbelief on the part of the viewer of the simulation - we don't expect solid objects to pass through each other. Therefore, a lot of the work performed by the physics engine is to attempt to prevent interpenetrations. This can be pretty tough, particularly when there are large numbers of objects stacked up all pushing downwards under the force of gravity (it's nearly as if they wanted to interpenetrate most of the time!)

Figure 18

96

Appendix

Collisions are missed - the so-called "bullet through paper" effect (see Figure 18.) Objects that are moving quickly will pass right through thin objects particularly if the time step is too large (i.e. a time t1 the bullet is in front of the piece of paper, but at the next time step, t2, the bullet has been placed on the other side of the piece of paper.) Interpenetration: the time scale is so large that objects become embedded in each other from one time step to the next - too deeply for the physics engine to be able to recover gracefully. In general there is not much you can do except decrease the time step. For interpenetrations this will often help, but for the "bullet through paper" effect this will usually not solve the problem. Try to avoid very thin objects and extremely fast moving objects. Inside & Outside One major consequence of the assumption of solidity and the problems of interpenetration is that you cannot consider most objects to be hollow. A common mistake is to create a box for a room and begin to place objects within the box, thinking these are being placed inside the room. A box, by default, is a solid geometry and any objects placed inside will be tagged as interpenetrating and will likely simply fall through the base of the box if simulated (i.e. collisions between the box and the objects will have been disabled by the physics engine).

A way around this is to represent the box using a polygon soup geometry (unconnected triangles). This will have the desired effect.

Set Position & Deforming Geometry


Physics engines like to control the scene completely. By this we mean the physics engine is carefully storing the state of all objects in the scene and updating this state from frame to frame. If some external system then makes some changes to the scene the physics engine needs to update its state accordingly. This is often fine except when the changes made to the scene actually violate the simulation stability that the physics engine has been attempting to maintain. Two good examples of this are users setting object positions or orientations (sometimes called object warping) and deforming meshes. Taking the first example it's easy to see how arbitrarily setting the position of an object in the physics scene may cause problems: If the object is moved to a position that causes an interpenetration; without additional information the physics engine will simply have to turn off collisions between the moved object and the object it has been moved into. If other objects are resting or stacked above the object that is moved; hopefully the stack will simply restructure to fill the gap made by the moved object. If other objects are attached to the moved object by springs or constraints: this is the worst case. By moving the object abruptly, the connections to the other objects are

Appendix

97

stretched instantaneously and can cause the system to explode. Objects may be moved outside of the control of the physics system if they are being keyframed in some way. For such objects, the Havok system needs to be informed that these objects can be expected to move unexpectedly - Havok will track these objects specifically and will attempt to resolve the situation, though not always successfully. In general try to avoid direct manipulation of objects. It is always better to apply forces and impulses (either linear or angular) to the objects to "push" them towards the desired goal. The case of deforming meshes is subtler, but is related to the difficultly in handling warping objects. An example of this is shown in Figure 19. Figure 19 shows deforming objects like the squished sphere need to be treated with care in a physics engine. The desired result is shown on the bottom, i.e. the blocks are pushed out of the way when the sphere bulges out. In this example, a sphere has been keyframed to squash (perhaps to simulate the effect of being squashed from above - note we are talking about keyframing here and not a soft object under physics control). Under normal circumstances this results in an interpenetration. The sphere's sides bulge out as it deforms into an ellipsoid shape, but this happens outside the control of the physics engine and therefore appears to happen instantaneously. This sort of thing can happen quite often, particularly in situations where meshes are

being generated automatically (e.g. in character animation a skin mesh around a set of bones deforms based on the position of the bones).

Figure 19

The correct result would involve the physics engine tracking the shape of the deforming mesh and when it spots a change in the mesh in a given time step it will use this with the shape of the mesh in the previous step (which it has remembered) to try and figure out how

98

Appendix

the surrounding affected objects should move. In this case, the deforming mesh will cause the two blocks on either side to be pushed outwards away from the sphere. The Havok system needs to be told that an object's geometry may deform outside of its control in order to achieve this result.

Collision Tolerance
One final but crucial feature of the Havok system is its implementation of collision tolerances. If you consider the previous sections on collisions and interpenetration you may have spotted that it's pretty hard for the physics engine to detect a collision without an interpenetration having taken place. Because the physics system is based on discrete time steps (of say 1/60th of a second) it is rare that a collision at a given time step will take place where 2 objects are just touching (i.e. a single point of contact). In Figure 20 this situation is illustrated. 2 spheres are traveling towards each other. At time steps t1 and t2 they are still apart, but at time t3 they have interpenetrated. To avoid this the Havok engine uses a system of collision tolerances. These are minimum distance values that specify how close objects can be before they are deemed to have collided. Consider the collision tolerance to be a "skin" of a certain thickness around the objects. If the skins overlap (or interpenetrate) the objects are said to have collided and the nearest points on the 2 objects are used as collision points. Figure 21 shows what happens when collision tolerances are used. In this case the spheres has a small collision tolerance that really means that the spheres have a collision proxy that is another slightly larger sphere. At time t2 each of the spheres has collided with the collision tolerance of the other sphere (note that it is not enough that only

Figure 20: Object collision are usually only detectable after they have occurred

Appendix

99

the tolerances have interpenetrated - one of the spheres must be inside the collision tolerance of the other). The system calculates the collision information, assuming that the objects have collided, and takes the appropriate action. As expected, with large values of the collision tolerance, you'll begin to notice that the objects are not actually hitting. This is particularly noticeable for objects that are stacked (you'll see gaps between them). In general the tolerance should be around 2% 10% of the size of the object itself. To remove most of these visual artifacts you should increase the size of the visual geometry by approximately half of the tolerance, or alternatively create a collision proxy that has been reduced in size by half the tolerance value.

Figure 21: Using collision tolerances, you can check to see if the tolerances overlap and if so consider the objects to have collided and take appropriate action.

100

Appendix

Setting the Scene The first stage in any physics simulation is to create the scene. This is slightly different to constructing a 3D scene without physics and is constrained by collision tolerances and requirements of non-interpenetration. If you construct a scene in the normal way you will run into difficulties placing objects so that they are stably resting on other objects without collision problems. As an example take the case of creating a stack of boxes of height h on the floor. Usually you will place the base of the first box at height 0, the second at height h, the third at height 2h and so on, as shown in Figure 22A. But given the collision tolerance issue mentioned in the previous section there will be problems with this approach.

Figure 22: Creating a stable stack

Depending on the numerical accuracy of the simulation, the faces of neighboring boxes will either be classified as interpenetrating or colliding. If interpenetrating, the boxes will fall through each other - if colliding they will immediately bounce off each other (albeit with very little energy, so you may get lucky). Another approach might be to place the boxes such that the collision tolerances overlap, but the boxes are not actually touching as in Figure 22 B. This can also cause

Appendix

101

problems, because the boxes are liable to settle for a while into a stable state (depending on external forces like gravity etc.) The best way around this is to use the physics engine itself. As shown in Figure 22 C, you should create the boxes initially separated by a distance of more than the collision tolerance. Now simply simulate the scene for a period of time; the boxes will fall the small distance and will settle into a stable stack. Eventually they will turn off as the energy management system kicks in. Now you have a stable stack that is turned off and ready to be saved. Store the positions of the boxes now you can use these positions to create your stack at a later point in time (making sure to turn the boxes off manually to fully recreate the state of the stack.) You are guaranteed that when the new simulation starts the stack will be stable and unmoving.

It is often useful, however, to fall back on an analysis of the scene and units used to at least determine the ballpark values required to achieve a desired goal. For simplicity we'll stick with the metric system in the following sections: m = meters kg = kilograms s = seconds N = Newtons (measurement of force: 1 N = force required to change the speed of a 1kg object by 1 m/s in 1 s). rad = radians (1 rad = 180/p degrees where p = 3.14159 ).
Note: Some implementations of the Havok

physics technology use degrees as units of angle. This will be clearly stated in the accompanying documentation. To read the units detailed below, apply the following conventions: nx/y = x per y e.g. m/s = meters per second (i.e. velocity or speed). Note that x/y is sometimes written as x y-1. nx/y2 = x per y squared or x per y per y e.g. m/s2 = meters per second squared or meters per second per second (i.e. acceleration)

Physical Units and Values


We've already dealt with the issue of scale and switching between units of measurement. Physics engines are not simply concerned with lengths and weights however - in fact there is a very large number of different measures in use at any given time. In this section we'll list some of these and give the units used to quantify them. Despite the apparent complexity of dealing with all these units, in many cases you will not need to worry: we find that experimentation with values is ultimately the best way to proceed when designing a scene.

Position Based
Position (m) A better description of this term is displacement or distance. Velocity (m/s) Speed - how fast is an object traveling relative to some frame of reference.

102

Appendix

Momentum (kg m/s) Velocity times mass: this is the property of an object that determines the amount of force required to change the velocity of something. For example a truck is harder to stop than a scooter even if both are traveling at the same speed. Acceleration (m/s2) Rate of change of velocity over time i.e. is an object speeding up or slowing down?

Figure 23). The most important thing to understand is that orientations require a reference frame, just as distance requires a reference point (i.e. giving a location as 10 meters away is useless without information about what / where it is 10 meters away from).

Impulse (kg m/s or Ns)


A measure of a change in momentum (usually measured in Newton seconds). If you want to instantaneously change the velocity of an object you must apply an impulse to the object. Force (N or kg m/s2) The basic unit of a physics engine. This is the quantity that measures the effort required to change the speed of an object (i.e. to give an object an acceleration - either positive or negative).
Note: Sometimes, to distinguish from their

angular counterparts (detailed in the next sections), velocity, momentum and acceleration are defined as linear velocity, linear momentum and linear acceleration.

Figure 23: Different ways to specify the orientation of an object in space

Orientation Based
Orientations are often one of the most difficult quantities to become familiar with. They can be specified in any number of ways, some of the most popular being a transformation matrix or an axis and angle or using one of the many "standards" like pitchyaw-roll, or azimuth-elevation-tile (shown in

Coordinate Systems and Reference Frames


In order to talk about orientations we need first to mention coordinate systems and reference frames. The orientation of any object in a scene is specified with respect to a coordinate system, often called the world coordinate system or world reference frame. A 3D coordinate system has 3 independent

Appendix

103

directions or vectors usually termed x, y and z and an origin (position). All positions and directions are specified with respect to these directions and the origin. When an object is created, we need to position it in the world and we do so by specifying its position and orientation; the object's position and orientation are termed its local coordinate system or local reference frame (i.e. local to that object). Figure 24 shows a scene with a global coordinate system and 2 objects, each with its own local coordinate systems and positions.

The physics engine always uses the COM for specifying rotations and orientations, whereas usually the 3D engine will use the object's geometric center or pivot as defined by the modeler. In Figure 24 each boxs geometric center is also at the COM (i.e. right in the middle of the box). The position of the box is taken to be the position of that center. The local coordinate system for each box is shown and these are defined relative to the global coordinate system. Specifying Orientations In Havok we specify the orientation of an object using a rotation. This rotation is defined by an axis, which is the axis or line around which we want to rotate, and an angle which is the angle to rotate around this axis. The rotation used is the rotation that would take the object from its starting orientation (usually lined up with the world reference frame) to its current orientation. Note that rotation angles are given as counterclockwise. This is a standard in computer graphics derived from our use of the right-hand rule for orientation specification. The right hand rule is simple to remember and is depicted in Figure 25.

Figure 24: Local and global coordinate systems

There is one final ambiguity to resolve (and one which can cause headaches when interfacing 3D engines with physics systems): what is the center of an object. If we say "place the object at the origin" (i.e. at position [0, 0, 0]) where exactly is it placed? This depends on which part of the object we line up with the origin: there are 2 options: The origin or pivot as specified by the geometry or modeler The center of mass (COM), which depends on the physical properties of the object (like the distribution of mass through the object i.e. is one end heavier than the other, like a hammer). The COM is the point around which the object will naturally spin.

Figure 25: Right Hand Rule

104

Appendix

Figure 25 shows the right hand rule for rotations: the thumb lines up with the axis to be rotated around and the direction the finger curl indicates the direction a positive rotation angle will rotate in. Armed with this information we can describe the method of specifying orientations in general. In Figure 26 we show how a rotation takes effect given an axis and angle. The top right image of the object , shows it at creation time (i.e. its local coordinate system is lined up with the world's). In the image below the object is now lined up to the required orientation

Angular Momentum (kg rad/s) Angular equivalent of momentum. This quantifies how hard it is to increase or decrease the rotational velocity of an object. Angular Acceleration (rad/s) Angular equivalent of acceleration. This is the rate of change over time of the angular velocity. Angular Impulse (kg rad/s or N rad) Angular equivalent of impulse. This is a measure of change in angular momentum. Apply an angular impulse to an object if you want to instantaneously affect its angular velocity. Torque (kg m2/s2 Nm) This is the angular equivalent of force, but needs a separate discussion below. Units are Newton meters. With Havok you can passively change the behavior of a body by applying forces, torques, impulses and angular impulses (or actively by setting properties like velocity or angular velocity). When applying impulse and forces it is important to specify the point with respect to the object to which the impulse / force is to be applied.

Figure 26: Specifying an orientation using an axis and angle

Orientation (Axis+angle) An objects orientation with respect to the world coordinate system. Angular Velocity (Axis+rad/s) The speed at which the object is rotating: i.e. the number of radians per second the object rotates, usually specified with the axis it is rotating around.

Appendix

105

Restitution (Dimensionless) The restitution coefficient (usually a value from 0 to 1) specifies what percentage of the kinetic energy is lost during a collision between 2 objects. With a value of 0 all energy is lost and the objects appear to come to a complete halt when they collide. With 1, no energy is lost and the objects will bounce off each other with an equal but opposite velocity. Somewhere in between the objects lose energy with each collision. Mass (kg) A measure of an object's resistance to change in motion, or the amount of matter in an object. Not to be confused with weight which is the attraction of the Earth's gravitational pull on a certain mass. To make matters confusing though, mass is defined officially by the weight of a mass of platinum-iridium in France. Dynamic and Static Friction Friction is that quantity which attempts to prevent surfaces sliding off each other and is the key factor in allowing stable stacking (i.e. stacks or piles of objects that come to rest, held in place by the friction at the points of contact). During all collisions a certain amount of energy is lost due to friction (and mostly converted to heat). Friction manifests itself in 2 forms, static and dynamic.

Figure 27: Applying forces at COM and at an arbitrary point with respect to an object's coordinate system

If a force / impulse is applied at the COM of an object that object's acceleration / velocity will change but no additional rotational velocity or acceleration will be introduced. On the other hand, when a force or impulse is applied at some other point away from the COM a torque is introduced which is proportional to the force / impulse applied and also the distance from the center of mass and will alter the angular velocity / acceleration of the object. Think of it as if a lever were attached from the COM to the point where you're applying the force / impulse - a longer lever makes it easier to move (or alter the angular velocity / acceleration of) a heavy object than a short lever.

Physical Properties
These properties depend on the materials making up the object and affect its behavior in a physical simulation. Friction (Dimensionless) The friction coefficient (usually a value from 0 to 1) which specifies how sticky or rough an object is. See below for a more detailed explanation.

106

Appendix

Figure 28: Static and dynamic friction in action.

The boulder is held in place by static friction until enough force is applied to break the contact (i.e. the plank has been raised to a sufficient height), after which the boulder begins to slide and dynamic friction kicks in which acts against the sliding action, generating heat. Figure 28 gives an example of static and dynamic friction in action. In Havok you set a single friction coefficient value and the engine manages the transition between the friction modes for you.
Figure 29: Constrained systems in action

Constrained Dynamics
In many cases we want to construct physics systems that have constraints or attachments between sub parts of a larger assembly. There are many types of constraint and some of those provided by Havok include: Springs: Forces are applied to objects connected by springs to attempt to keep the objects within a desired distance from each other (the rest length). Dashpots: Stiff springs. Reduced coordinate systems: Systems of rigid bodies are not simulated independently but are simulated as a large system all at the same time. Some reduced coordinate constraints include hinges, ball and socket joints, prismatic joints and universal joints.

Next Steps
We've briefly covered most of the main topics of physical simulation. This is a very rich subject matter and there's certainly a lot more to know but this should be sufficient to help you understand Havok documentation, whether for reactor or other Havok products. We have specifically not attempted to cover all areas of the Havok physics technology but have focused instead on the general principles that underpin all simulation. We'll briefly describe now some of these other physics technologies available from the Havok engine.

Appendix

107

Constraints are a requirement for creating any dynamic system like a car chassis, or a locomotive engine. Forces applied to one object are instantaneously applied to all objects connected to this one, so when the piston on a locomotive pushes forward, the wheels begin to spin. See Figure 29 for some examples of constrained systems. The fan blade is connected to the base via a revolute joint and the water machine on the right uses a series of constraints to create the water powered block pushing mechanism.
Figure 30: Examples of deformable objects

Non Rigid Body Dynamics


So far we have been assuming that all objects are rigid (i.e. the geometry or shape does not change during the simulation). In order to simulation soft, cloth, rope or liquid objects we need to lift this restriction. Most of what has been discussed earlier still applies except for the details of collision detection. For deformable objects, collision detection becomes much more difficult - given that the object can change shape dramatically between time steps and also can attempt to collide with itself (this is particularly true of cloth, where interpenetration prevention is very expensive). Some examples of deformable surfaces are shown in Figure 30.

Figure 30 shows (a) lots of cloth and rope elements used in a scene (courtesy of Blizzard Entertainment) (b) a piece of cloth slides over a mannequin's head (c) blobby objects land on a hard surface (d) a water pool simulation with floating raft and rubber duck.

108

Appendix

Analyze World
The Analyze World function alerts you if you are using unusual values in your scene. For example, if your scene has a very high gravity setting or uses large objects with a very small mass, the Analyze World function detects these values and notifies you. The Analyze World button is located in the Advanced rollout.

Bounding Box
A bounding box is an enclosing box that surrounds an object in order to give it a convex geometry. Using a bounding box, you can give a convex geometry to an object that is displayed as concave. The Use Bounding Box option is displayed in the Properties rollout.

Bounding Sphere Angular Dashpot


An angular dashpot is a type of dashpot that attempts to force objects to maintain their initial relative orientations. If you rotate one, a turning force is applied to both to try to equalize their orientations. Dashpots are highly damped springs. Use them to constrain the movement of objects with reference to a point, or to another object. A bounding sphere is an enclosing sphere that surrounds an object in order to give it a spherical geometry. The object is then treated as a perfect sphere that contains its original geometry. The Use Bounding Sphere option is displayed in the Properties rollout.

Camera
The Camera button in the Display rollout enables you to select a camera as the display camera. The scene in the reactor display window is viewed from the selected camera. If you do not set a camera, reactor uses the default starting camera.

Animation Rollout
The Animation rollout contains the basic animation parameters. Use the Animation rollout to specify the start and end frames for creating 3ds max keyframes, as well as the number of frames per second.

110

Glossary

Cloth
A two-dimensional mesh of triangles used for objects such as fabrics, cloaks, sheets of metal, and other flat or folding bodies.

Concave
A concave object is any object that does not pass a Convexity Test. Most objects in the real world are concave. Concave objects can have holes, cavities, or non-closed geometries. Concave objects include spirals, teapots, and sinks.

Cloth Collection
The term used to describe a set of cloth objects. Cloth must be added to a collection, so that they be can be solved for simulations.

Convex
Objects are convex if, given any two points inside the body, you can always go in a straight line from one to the other without going out of the body. Convex objects include cylinders, spheres, and boxes.

Collision Tolerance
Collision tolerance is the value below which objects collide in a simulation. Higher collision tolerance values usually mean more stable simulations. A balance must be struck between stability and visual effect. The Collision Tolerance option is located in the Advanced rollout.

Damping
Damping means reducing the energy of a spring or a soft body so that its fluctuations in shape reduce with each oscillation.

Command Panel
A command panel displays a collection of related buttons and fields. It has an identifying tab at the top to enable easy selection. Command panels contain rollouts, which lead to sub groups of related buttons and fields. 3ds max has six command panels. These are: Create, Modify, Hierarchy, Motion, Display and Utilities.

Dashpot
A dashpot is a special type of highly damped spring. You can use dashpots to constrain the movement of objects.

Density
For fluids, this describes how dense the fluid is with respect to water(Relative density). For instance light oil would have a density of about0.7. Density determines whether an object will float or sink in a fluid. An object's density is automatically calculated using its volume and mass. Cloth uses a property called Buoyancy to determine its density, as it has no volume.

Compound Rigid Bodies


Compound rigid bodies are rigid bodies composed of more than one primitive. To construct a compound rigid body, use the 3ds max function to group together a number of primitives. Compound rigid bodies are useful if the density of the object you want to model is not uniform or if the object is concave but can be easily decomposed into several convex primitives.

Glossary

111

Deformable Mesh
A deformable mesh is a special type of object that you can use as a skin. For example, you could use one as the skin of a character. Deformable meshes work on a kind of skinand-bones basis, where the mesh forms the skin and several rigid bodies form the bones.

Dynamic Friction
Dynamic friction refers to the friction associated with a moving object. It is a measure of the resistance between two objects rubbing against each other.

Elasticity
The elasticity coefficient of a rigid body is the factor that determines the ratio of a body's speed before and after a collision.

Deformable Mesh Collection


A deformable mesh collection (created using the DMCollection option) is a collection for deformable objects, which enables you to assign different solvers to determine their movement in a simulation.

Entity Collection
Entities are the main components of a simulation and are grouped into entity collections. A rigid body collection is an example of an entity collection.

Deactivator
You can use a deactivator to tell the engine to remove an object from a simulation once its energy level has dropped to specified level.

Freeform Deformation
Freeform deformation (FFD) is a tool that you can use to encase a soft object in a simple mesh. This mesh then governs the movement and reactions of the soft object, which gives you greater speed in resolving their reactions.

Display
The Display rollout contains the basic parameters that control the reactor preview simulation. You use the Display rollout to select the appropriate camera and lights, and to select the texture quality of the preview.

Friction
Friction is the resistance of one surface to another that moves over it. It is the force that makes it difficult for one object to slide along the surface of another. reactor enables you to specify the friction associated with an object.

Display Proxy
In the Properties rollout, you can associate an object with another object. In a simulation, the associated object is displayed in place of the original object. Display Proxy is the term used to describe the associated object.

Lights
Select lights using the Lights section in the Display rollout. If you do not select any lights, a default light is used from the same position as the camera. You can add up to six lights to a simulation.

112

Glossary

Linear Dashpot
Linear dashpots are highly dampened springs. You use them to constrain the movement of objects with reference to a point or another object.

Optimized Convex Hull


The optimized convex hull of an object is typically used for concave objects. The convex hull of an object is optimized for simulation by decreasing the tessellation. The Optimized Convex Hull option is located in the Properties rollout.

Mass
Mass is a property of all reactor bodies. Single primitives can have a mass, as can compound bodies. Compound bodies are the only bodies that can have unevenly distributed mass.

Optimized Geometry / Mesh


Optimized geometries are geometries that have been less highly tessellated in order to speed up simulation or display. The optimization options are located in the Properties rollout. The Optimized Mesh option can be used to substitute the geometry of a convex object with an optimized version of its geometry.

Mesh
The Use Mesh function stipulates that the actual mesh of an object should be used for simulation.

Mesh Convex Hull


The Mesh Convex Hull option is located in the Properties rollout. Use this option to surround a concave object with an invisible wrapping. When you do this, reactor treats the object as convex during simulation.

Plane
A plane is a flat surface. The Plane system in the Create command panel inserts a plane. In reactor, in the Helpers you will find another plane. This plane represents a half-space and is infinite. Unlike a standard plane, the reactor plane does not require the specification of a concave mesh.

Mouse Spring
In the reactor display window, you can use the mouse to interact with the simulation. You can right-click on an object and move it to another location. The mouse spring is the virtual spring that exists between the mouse pointer and the object in the scene. If you increase the strength of the spring, it is easier to move objects. Mouse Spring settings are located in the Display rollout.

Preview In Window
The Preview In Window button enables you to view and interact with your scene in real time within the reactor display window. The Preview In Window button is located in the Display rollout.

Glossary

113

Proxies
Proxies are objects whose geometry is used to replace that of another object. You may use a substitute when displaying or simulating a body. For simulation of a body, you may also use the convex hull of a proxy object. The proxy options are located in the Properties rollout.

Rigid Body Collection


A Rigid Body Collection is a specially defined term used to describe a set of rigid or hard objects. Rigid bodies must be added to a collection for reactor to apply solvers to them.

Shadows
You can view shadows in the reactor display window. Only lights on to a plane can cast shadows.

Proxy Convex Hull


A Proxy Convex Hull is the convex hull of a proxy simulation object. A body may be simulated using the convex hull of another object. This other object is referred to as the proxy object. To use the proxy convex hull, go to the Simulation Geometry section of the Properties rollout.

Simulation
A simulation is a preview of your scene or animation. You can preview your scene by clicking the Preview In Window button in the Display rollout. If you make any changes to the properties associated with your animation in the Animation rollout, you must click the Perform Simulation button to re-compile your animation.

Proxy Mesh
A proxy mesh is a mesh or geometry that can be substituted for the actual geometry of an object during simulation. This proxy object can be concave or convex, regardless of the original body.

Soft Body
A soft body is an object whose shape is deformable in reaction to the impact of forces and other objects in a simulation.

Rest Length
Rest length is the length of a spring at which there is no force applied to it. A spring will always tend towards its rest length.

Soft Body Collection


The term that describes a set of soft or flexible bodies. To include a soft object for solvers it must be added to a Soft Body Collection.

Rigid Body
A Rigid Body is one of the most basic types objects. Rigid bodies are literally objects whose shape does not change in a scene. They are commonly used to represent many kinds of objects, from tables and chairs to teapots and rocks.

Solver
A Solver is a function that calculates the reactions of a body when placed in a simulation. Solvers work on collections of objects, and there are different kinds of solvers available for different kinds of objects.

114

Glossary

Spring
A spring is an elastic connection between two objects. You use the spring system in reactor to constrain the movements of objects.

Test Convexity
The Test Convexity button in the Properties rollout checks whether an object is convex or not.

Static Friction
Static friction refers to the friction associated with an object while it is at rest. It is a measure of resistance in response to an external force tending to slide an object over another.

Texture Quality
Texture quality refers to how detailed the textures used for display are. These can be 256x256, 128x128 or 64x64. The more detailed the textures, the slower a display may run.

Toy Car Steps


A step is a single reactor simulation step, within which there may be several substeps to increase the accuracy of the simulation. There is a one-to-one mapping between steps and 3ds max keyframes. The Toy Car is a feature included in reactor that allows you to create cars and other vehicle types quickly and easily.

Unyielding Bodies
Unyielding bodies are objects whose keyframed animations are strictly observed within a reactor simulation.

Stiffness
Stiffness is the property of a spring that determines how quickly a spring returns to its rest length. Very high values of stiffness in a spring can cause instability.

Viscosity
For fluids, this describes how much resistance an object experiences as it tries to move through the fluid. Water is assumed to have a viscosity of 1.0.

Substeps
Substeps are steps within steps. Increasing the number of substeps in a step improves the precision of an animation.

World Scale Parameter


The World Scale parameter stores the correspondence between the units you have used in your scene and the units that will be used in the reactor simulation. 3ds max lets you use whatever units you want. When simulating, reactor must know the ratio between 1 unit in 3ds max and 1 meter in the simulation. The World Scale parameter is located in the Advanced rollout.

System
Systems are constraints that impact upon objects in a simulation. Systems can change the properties of objects and control the relationships between objects.

Symbols
.cui file 3

Numerics
3D coordinate 102 3D display 88, 89 3D display system 84 3D engine 103 3D modeler 84 3D scene 100 3ds max 4 1, 3, 5, 9, 10, 11, 16, 17, 19, 20, 21, 22, 24, 26, 28, 32, 39, 42, 50, 57, 59, 60, 61, 62, 64, 69, 71, 73, 75, 78, 84, 109 internal hierarchy 11 3ds max 4 hierarchy 73

A
Accelerate key 88 Acceleration 88, 101, 105 Accuracy 60, 78, 79, 80, 81, 86, 88, 89, 94 Accuracy of result 88 Accurate integrator 88 Accurate rejection test 92 Accurate simulation 62 Action 53 fracture 54, 56 motor 54, 56 wind 53, 54 Actions adding 54 Add button 8, 23, 29, 35, 46, 50, 57, 68 Add Drag Action 77 Adding a deactivator 12 Adding lights 9 Advanced Parameters 32

Advanced rollout 11, 24, 62, 63, 75, 77, 109, 110, 114 Advanced simulation options 77 Air resistance 85, 86 Aircraft hangar 83 Airflow 79 Algorithm 87 Allow Wheel Penetration 50 Analyze before simulation checkbox 78 Analyze World 50, 75 Analyze World button 78, 109 Analyze World function 109 Analyze World test 78 Analyze World utility 46 Ang parameter 77 Ang Speed 56 Ang. Speed 56 Angle 102, 103 Angular acceleration 104 Angular damping 77 Angular dashpot 42, 44, 109 Angular impulse 104 Angular momentum 104 Angular speed 50 Angular Strength 51 Angular velocity 77, 104 Animate button 61 Animation 11, 20, 24, 32, 39, 57, 59, 60, 61, 62, 63, 78, 81, 82, 85 Animation bar 60, 61 Animation playback 82 Animation rollout 60, 61, 64, 109, 113 Animation section 61 Animation Time 64 Applies To... section 55 Applying a proxy to a group 18

116

Index

Applying textures 10 Artifact 94, 99 Assembly 81 Assigning a material 10 Atmosphere 86 Attach to Rigid Body constraint 48 Attach to Rigid Body modifier 45 AttachToRB modifier 49 Avoid Self-Intersections option 29, 30 Axis 102, 103 Axis of rotation 47, 56 Azimuth-elevation-tile 102

B
Back Euler 88 Back-Euler 12 Background Color menu option 4 Ball and socket joint 47, 106 Ballistic motion 79 Behavior 81 Believability 81 Bend 30 Bind to Space Warp icon 39 Blizzard Entertainment 107 Body space 44, 56 Bone 97 Bones 62 Boolean compound 60 Boulder 106 Boundary condition 80 boundary condition 80 Bounding box 16, 91, 92, 109 Bounding Sphere 60 Bounding sphere 16, 109 Box Faces radio button 25 Box overlap 92 Break after collision 57 Break during collision 57 Building a compound rigid body 17 Building compound rigid bodies 17 Bullet through paper effect 96 Buoyancy 27, 29 Buoyancy properties 37 Buoyancy property 110 Butterfly effect 81

C
Calculation 79, 86 Camera 4, 5, 28, 35, 38, 48, 109 adding 9 Camera button 109

Camera Setting menu option 4 Cameras adding 3 Cannon ball 85 cannon ball 86 Canon ball 85 Car 49, 50, 80 Car chassis 94, 107 Car model 41 Cast Shadows on Plane option 6 Casts shadows checkbox 5 Cellophane wrap 93 Center of mass 103 Centimeter 84 Changing scale 83 Chaos 81, 82 Chaotic behavior 82 Character 82 Character animation 62, 97 Chassis 50 Chassis button 50 Cheap solver 46 CLCollection button 29 Closed surface 93 Cloth 27, 28, 30, 31, 32, 45, 48, 49, 53, 54, 92, 107, 110 air resistance 29 assigning properties 27 damping 28 deformation 29 friction 28 intersection 29 mass 28 physical properties 27 relative density 29 smooth level 29 stiffness 28 vertex selection 29 Cloth collection 29, 31, 48, 54, 110 adding bodies 29 adding objects 27 creating 27 Cloth collections 27 Cloth dynamics 30 Cloth modifier 48 Cloth simulation 32 Clothing 81 Coefficient of friction 23, 28, 35 Coefficient of restitution 77 Collection 12, 39, 46, 62, 81 Collection symbol 23 Collections

Index

117

creating 3 Collinear creasing 32 Collision 57, 62, 68, 84, 88, 90, 93, 94, 95, 96, 98, 99, 100, 105 detection 93 Collision detection 26, 50, 76, 84, 88, 90, 92, 93, 95, 107 Collision force 88 Collision geometry 92 Collision pair 90, 91, 95 collision point 98 Collision proxy 98 Collision resolution 76, 77 Collision result 92 Collision system 91 Collision test 92, 93 Collision tests 90 Collision tolerance 76, 77, 95, 98, 100, 110 Collision Tolerance option 110 Collisions 24, 49 COM 103, 105 Command panel 110 command panels Create 73 Commands 68 Common Local Orientation 50 Complex collision 91 Complex collision test 91 Complex display geometry 94 Complex fold stiffness 30, 31 Complex force model 30 Complex forces 30 Complex Friction resolver 77 Complex test 91 Compound body 54 Compound objects 17 Compound rigid body 19, 28, 56, 110 Compression and expansion 23 Computational fluid dynamics 79 Computer graphics 103 Concave 11, 13, 15, 22, 60, 93, 110 Concave geometry 94 Concave mesh 22 Concave object 13, 17, 19 Concave properties rollout 17 Confined path 47 Conform to Shape button 26 Constrain button 73 Constrain Deformation 29, 32 Constrain IK Chain with Points utility 73 Constrained dynamics 106 Constrained system 88, 107

Constraint 34, 35, 44, 45, 46, 49, 53, 56, 77, 96, 106, 107 AttachToRB 48 point-to-nail 45, 47 point-to-path 45, 47 point-to-point 45, 46 solver 45 Constraint model 35 Constraint solver 45, 47, 73 Constraint strength 56, 73 Constraint system 45, 77 Constraint systems 41 Constraints 41 Continuum of simulation 80 Convex 11, 15, 60, 93, 110 convex 17 Convex hull 16, 19 Convex object 13 Convex segments 17 Convexity Test 110 Convexity test 14 Coordinate system 102, 105 Corrective forces 51 CPU 89 CPU allocation 89 CPU bandwidth 90 CPU cost 94 CPU load 88, 90 CPU power 88 CPU resources 79, 90 CPU time 89, 90 Create command panel 42, 43, 112 Create menu 35 Create panel 8, 23, 38, 47 creating 3 Creating a cloth 27 Creating a scene 3, 8 CSolver 46 CSolver system 56 Current orientation 44 Customize menu 3

D
Damping 6, 21, 42, 45, 110 damping 28 Damping coefficient 23, 28, 35 Damping parameter 30 Dashpot 41, 42, 44, 45, 106, 110 adding 41, 44 angular 42, 44 consistency 44 established points 44

118

Index

forces 44 linear 42, 44 properties 41 strength 45 zero rest length 42 Deactivate 39 Deactivation 90 Deactivator 12, 39, 111 Samples option 12 Time option 12 deactivator 12 Decreasing accuracy 89 Define Collision Pairs option 12 Defining collision pairs 12 Deformable material 92 Deformable mesh 111 Deformable mesh collection 111 Deformable object 107 Deformable surfaces 107 Deformation 29, 62 scale strength 39 Deforming geometry 96 Deforming mesh 62, 96, 97 freeze 63 Updates/Frame 63 Deforming mesh collection 62 Deforming mesh properties 63 Degree 101 Delaunay checkbox 32 Delaunay triangulation 32 Delete button 68 Delete Keyframes button 63 Delete Now button 63 Density 17, 39, 50, 110 Dialog box 72, 84 Differential equation 87 Dimensionless 105 Dimensionless unit 84 Disable All Collisions 62 Disabled 12, 51 Disabled checkbox 11 Disabled list 12 Disabling collections 11, 24 Discrete event 80 Discrete event simulation 80 Disk space 63 Display 6, 11, 88, 89, 111 Display Children option 11, 73 Display frame rate 11 Display geometry 14, 94 display geometry 16

Display menu 4 Display Proxy 20 Display proxy 11, 18, 20, 111 Display rollout 5, 6, 9, 44, 60, 109, 111, 112, 113 Display simulation 37 display simulation 24 Display Subtree option 18 Display update frequency 89 Display window 3 display window 9 Distance 31 DMCollection button 62 DMCollection option 111 Do not affect rigid body option 49 Documentation 106 Drag action 77 Dynamic friction 105, 111 Dynamic system 107 Dynamics simulation 76

E
Edges menu option 4 Elastic connection 41 Elasticity 7, 9, 10, 69, 111 Element 54, 68, 79 Element based simulation 81 Ellipsoid 97 Enable Sheltering option 55 Enabled 12 Enabled list 12 End 63 End Frame 60, 61, 63 Energy 12, 30, 42, 57, 100, 105 Energy Loss 57 Energy management 90 Energy management system 101 Energy threshold 24 Entities 77 Entity 12, 80, 81, 111 Entity collection 7, 27, 29, 111 Environment 85 Euler 12, 88 Events 80, 81 Evolution 87 Example scripts 69 Expensive solver 46 Exported information 19 External force 82, 85, 86, 101

Index

119

F
Faces menu option 4 Factors 86 Fan 54 Fan blade 107 FFD 24, 25, 61, 111 changing configuration 26 FFD (un)selection panel 25 FFD animation 61 FFD box sides 25 FFD mesh 26, 61 FFD mesh selection 25 FFD modifier 21 FFD Soft Bodies Only constraints 49 FFD soft body 24 FFD-Based button 25 Final collision test 92 Finger 104 Finite element 79 Fixed end 33 Fixed Step menu option 4 Fixing 24 Floating toolbar 69 Fluids 37 Fogging 89 Fold stiffness 30, 31 Force 56, 81, 84, 86, 88, 95, 97, 101, 104, 105, 106 Force models 30 Forces 49, 51, 76 Fracture 53 Fracture action 56, 57 Fracture Properties 57 Fracture set 54 Fracturing body 57 Frame 26, 60, 61, 89, 96 Frame field 26 Frames/Key value 60 Free end 33 Freeform deformation 24, 111 Freeze checkbox 63 Frequency 55 Friction 7, 9, 10, 17, 21, 69, 90, 105, 111 friction 10 Friction coefficient 10, 105, 106 Friction force 88 Friction values 77 Function 69

G
Gain 56 Game 81, 82, 85 Game scenario 82 Gap 93 General principle 106 General solver 46 Generic unit 75 Geometric center 103 Geometry 26, 84, 92, 94, 96, 98, 103, 107 Geometry / Sim Edges option 20 Geometry menu 4, 15, 16 Geometry proxy 19, 20 Get from / Set to Material 10 Get From Material 10 getUserProp 69 Global coordinate system 103 Global value 76 glossary 109 Granularity 89 Graphical display 89 Graphical representation 37 Graphics system 85 Gravitational pull 84, 105 Gravity 75, 76, 83, 84, 85, 86, 95, 101 Gravity menu option 4 Grid 79 Grid lines 31 Group function 17 Group menu 18 Groups 17

H
Hardware acceleration 89 Havok 81, 83, 85, 95, 97, 103, 104, 106 Havok engine 83, 84, 88, 89, 90, 98, 106 Havok physics 101, 106 Havok physics engine 79, 83, 93 Havok physics primer 79 Havok products 79 Havok system 91, 92, 97, 98 Havok technology 79, 106 Havok* list 68 HavokPerformSimulation 69 Heat 105 Heat distribution 81 Helix Shape 34 Help menu 65

120

Index

Helpers 23, 112 Helpers drop-down menu 8, 42, 43 Helpers icon 8, 42, 43 Helpers option 23, 25, 35 High-end simulation 80 Higher accuracy 88 Hinge 106 HK* list 68 HKRBCollection 68 Hole 93 Hollow 93, 96 Hookean spring 42

K
Keyframe 24, 50, 59, 60, 61, 63, 78, 97, 109 clearing 61 keyframe 63 Keyframe reduction 1, 63 Keyframed animation 59 Keyframed body 77 keyframed body 59 Keyframed motion 62 Keyframes 1 Keystone pieces 57 Kilogram 83, 101 Kilograms 83 Kilometer 84 Kinetic energy 105

I
Icon Orientation 50 Ignore Collisions option 49 Ignoring collision 62 ignoring collision 48 IK chain 71 Images 89 Impact position 81 Implicit 93 Impulse 54, 57, 97, 102, 104 Inaccurate simulation 63 Inch 75, 84 inch 76 Individual behavior 80 Industrial design 79 Initial condition 88 Initial physical properties 69 Initial position 61 Initial velocity 61 Input 88 Integration step 24 Integrator 45, 87, 88 Integrators 87 Interaction 84 interaction 84 Interface with display 84 Internal integration step 31 Internal Substeps 50 interpenetrate 13 Interpenetration 12, 95, 96, 98, 99, 100 Interpenetration prevention 107 Interpolate 62 Interpolation property 77 Iterations of subdivision 24 Iterative subdivision 29

L
large 106 Large force 93, 95 Large meshes 31 Large system 106 Laws of motion 82 Length 101 Lever 105 Light 28, 35, 38, 48, 111 Lighting 89 Lighting, Shadows menu option 4 Lights 5 adding 3 Lights and Cameras tab 9 Lin parameter 77 Line 103 Linear acceleration 102 Linear damping 77 Linear dashpot 42, 44, 112 Linear momentum 102 Linear Strength 51 Linear value 76 Linear velocity 77, 102 Link hierarchy 73 Liquid 92, 107 Load Custom UI option 3 Local 56 Local coordinate system 103, 104 Local reference frame 103 Location 44 Locomotive engine 107 Lower limit 89

Index

121

M
Macro script 69 Magnitude 55 Main toolbar 39 Margin of error 80 Mass 7, 9, 17, 21, 22, 28, 34, 39, 49, 56, 61, 69, 73, 75, 105, 112 mass 10 Material 39, 105 Material Editor 10 Math 86 Mathematical representation 93 Matter 105 MAX menu 5 Max menu 32, 64 Max Mouse Mode 4 MAXScript 65, 69, 72 running scripts 72 running simulation 69 setting physical properties 69 MAXScript array 68 MAXScript command 65, 68, 69 MAXScript function 69 MAXScript Listener 65 MAXScript menu 65 MAXScript Reference option 65 MAXScript utility button 72 MAXScript utility rollout 72 Mechanical simulation 82 Memory 63 Memory usage 19 Mesh 17, 19, 24, 25, 27, 30, 31, 32, 38, 48, 60, 61, 62, 97, 112 Mesh complexity 61 Mesh convex hull 112 Mesh Convex Hull option 112 Mesh Select 48 Mesh Select modifier 24, 54 Mesh Select option 48 Mesh Smooth modifier 24 Meter 75, 83, 101 Meter scale 84 Meters 83 Methodology 79 Metric system 101 Midpoint 12, 88 Mile 84 Min. Energy field 12 Min/Max bar 16, 17 Minimum distance 98 Minimum safe distance 76 Model 80

Model car 49 Modeler 84, 103 Modifier rollout 68 Modify 48 Modify Branch option 5 Modify panel 11, 24, 25, 28, 50, 61 Modify Properties rollout 45 Modify rollout 34 Modify section 22, 45, 48, 56 Modify tab 8, 23, 35, 38, 43, 46 Momentum 57, 102, 104 More button 2 More 48 Motion 62, 84, 86, 87, 105 Motion restriction 41 Motor 53, 56 Motor action 54, 56 Motor symbol 56 Mouse pointer 35 Mouse spring 6, 23, 112 Mouse Spring setting 112 Movement 84 Movie 85, 88 Movie production 88 Multi-phase collision detection 92 Multiphase collision testing 91

N
Nave resolver 77 Navigating a simulation 10 Newton 101 Newton meter 104 Newton second 102 Newton's laws of motion 86 Newtonian mechanics 82 Newtonian resolution 77 No Friction resolver 77 Node 20 children 20 Non 24 Non Selected Are Fixed option 49 None button 9, 11, 26, 43 Non-fixed objects 10 Non-Selected Are Fixed option 54 Non-Selected are Fixed option 24 Non-selected Are Fixed option 29 Non-zero mass 61 Normal 92 Normal piece 57 Normalize Spline 34 Numerical accuracy 100

122

Index

Numerical integration 87 NURB 94 Nurbs modifier panel 32

O
Object 11, 14, 33, 37, 39, 41, 43, 44, 49, 53, 62, 64, 65, 68, 75, 76, 77, 79, 80, 81, 82, 84, 86, 87, 88, 90, 91, 92, 93, 95, 96, 98, 99, 102, 104, 107 active 90 animating 59 behavior 41 center 103 complex 20 concave 93 convex 93 implicit 93 interpenetrating 95 mesh 16 physical properties 1 polygon soup 93 polygonal 93 proxy 11 reactivation 90 shape 92 simple 20 stacked 99 surface 93 toy car 49 treating as concave 16 treating as convex 14 turning off 90 Object complexity 90 Object property 84 Object Type rollout 8, 43 Object warping 96 Objects pivot 43 Objects applying physical properties 3 colliding 93 containing other objects 16 deactivating 12 simplified 94 Odd parameters 78 ODE solvers 11 Optimization 15 Optimize modifier 19 Optimized convex hull 112 Optimized Convex Hull option 112 Optimized geometries 19 Optimized geometry 112 Optimized Mesh option 112

Ordinary Differential Equation 11 Orientation 41, 42, 44, 50, 51, 62, 81, 85, 88, 96, 102, 103 Origin 103 Original shape 93 Oscillation 35

P
Parabolic arc 85 Parameter 87 Parameters 81, 87, 90 Parent object 73 Perform Simulation 60, 61 Perform Simulation button 113 Performing a convexity test 14 Perturb Speed 55 Perturb Speed checkbox 55 Perturb Time box 55 Physical animation creating 59 Physical body 62 Physical data 59 Physical properties 7 Physical property 105 physical property 69, 103 Physical representation 75 Physical simulation 59, 75, 79, 90, 93, 95, 105, 106 physical simulation 88 Physical system 53, 81 Physical world 75 Physics 11, 24, 59, 62, 82, 89, 97 Physics engine 69, 82, 83, 84, 85, 89, 90, 95, 96, 97, 101, 102 physics engine 92 Physics menu 4 Physics scene 96 Physics simulation 81, 86, 89, 100 Physics step 89 Physics system 87, 97, 98, 103, 106 Physics systems 83 Pick button 6, 9, 23, 29, 35, 46, 68 Piston 107 Pitch-yaw-roll 102 Pivot 47, 103 Plane 93, 112 Plane system 112 Planetary 82 Platinum-iridium 105 Play/Pause menu option 4 Plugin 3, 53, 75 plugin 6, 7 Point 43, 44, 47, 81, 93

Index

123

Point button 43 Point of collision 92 Point of contact 105 Point-Path 47 Point-Point option 46 Point-to-nail constraint 41, 47, 56 Point-to-path constraint 41, 47 Point-to-point constraint 41, 46, 47, 73 Polygon 31, 93, 94 Polygon mesh 93 Polygon soup 93, 95, 96 Polygonal 93 Polygons 89 Position 35, 41, 62, 81, 84, 86, 88, 95, 96, 97, 101, 103 Positive rotation 104 Precalculation 61 Preview 50, 56, 57 preview 15 Preview In Window 5, 19 Preview in window 112 Preview In Window button 10, 44, 112, 113 Preview in Window button 23, 30, 35, 39, 60 Preview mode 37 Preview window 6, 11, 15, 20, 24, 32, 44, 57, 64 Preview-In window 1 Previewing a scene 3 Previewing the simulation 3 Primitive 17, 19, 20 Prismatic joint 106 Process 76 Properties 9 Properties menu 3, 63 Properties panel 73 Properties rollout 9, 10, 11, 14, 15, 16, 22, 25, 28, 34, 45, 46, 48, 56, 62, 63, 109, 111, 112, 114 Properties section 6, 30, 46, 48 Proxy 94, 113 Proxy convex hull 113 Proxy geometry 94 Proxy mesh 113 Proxy object 16, 85, 94 Proxy objects 94 Proxy option 11

Q
Quad menu 2

R
Radian 101, 104 Rate of ascent 85 RBCollection 46

RBCollection button 8 RBCollection Properties 11 RBCollection Properties rollout 8 Reactor introduction 1 plug-in 2 quad menu 2 toolbar 2 reactor 25 Reactor AttachToRB 48 Reactor Cloth modifier 27, 28, 54 Reactor constraint tree 71 Reactor directory 72 Reactor Dynamics 2, 8, 29, 38, 42, 46, 47, 50, 54, 56, 62, 112 reactor Dynamics 35 Reactor Dynamics drop-down menu 23 Reactor Dynamics option 23, 25 Reactor Dynamics rollout 3 Reactor panel 2 Reactor plane 112 reactor Rope modifier 34 Reactor SoftBody modifier 25 Reactor SoftBody option 22, 25 Reactor toolbar 69 Reactor utility 9, 15, 22, 28, 34, 44, 60, 61, 62, 68, 69, 72 reactor utility 34 Reactor Water 37 Reactor.mcr 69 real 11 Real environment 82 Real Time menu option 4 Real world 95 Real world scales 82 Real world scenes 84 Realism 81 Realistic collision 93 Real-time 11, 20, 31 Real-time game 88 Real-time performance 88 Real-time simulation 24 Real-time system 82 Reduce After Simulation option 63 Reduce Keyframes button 63 Reduce Now button 63 Reduced coordinate constraint 106 Reduced coordinate system 106 Redundant keyframe 63 Reference frame 102 Reference point 102 Relative density 29

124

Index

Rendered animation 11 rendering animation 39 Reset menu option 4 Resolver 77 Complex Friction 77 Nave 77 No Friction 77 Simple Friction 77 Rest length 6, 76, 113 Rest position 64 Restitution 105 Restitution coefficient 105 Revolute joint 107 right mouse button 44 Right-hand rule 103 Rigid body 7, 8, 9, 17, 20, 21, 24, 28, 31, 35, 38, 42, 45, 48, 53, 54, 63, 77, 92, 93, 106, 113 adding a point 42 compound 14, 17 fixed 63 properties 10 rigid body 7 Rigid body button 56 Rigid body collection 7, 8, 9, 15, 16, 18, 21, 22, 25, 28, 33, 34, 38, 45, 46, 48, 49, 54, 56, 60, 61, 62, 68, 73, 113 adding bodies 8 creating 7 properties 11 symbol 8 Rigid Body Collection button 57 Rigid body dynamics 107 Rigid body list 68 Rigid body properties 72 Rigid body simulation 92 rigidBodiesTab 68 Ripple 53, 55 Ripple checkbox 55 Ripple variance 53 Ripples 37 RK45 88 Rope 33, 34, 45, 107 air resistance 35 compression 35 constraint-based model 33 creating 33 expansion 35 friction 35 mass 34 spring based model 33 stiffness 34 strength 34

stretch 34 surface 35 thickness 34 type 35 Rope collection 33 adding ropes 35 creating 35 Rope modifier 33, 34 Rope properties 34 Rope Type option 34 Rotation 42, 54, 103 Rotation axis 54 Rotational velocity 104 RPCollection button 35 Run button 72 Runga Kutta 88 Runge-Kutta 12 Running a simulation 10 Run-time 20

S
Save Before Simulation option 78 SBCollection button 23 SBCollection option 25 Scale 23, 75, 82, 83, 84, 86 Scale Timestep parameter 23, 24, 31 Scene 35, 81, 100 Scene origin 68 Scenes 27, 42, 49 Scenes folder 8, 22, 25, 33, 37, 53, 72 Script 65 Scripted motion 62 Scripting language 65 Scripts subdirectory 72 Second 101 Select by Name list 18, 43 Select Rigid Bodies dialog box 8 Self-intersection 93 Semiconductors 79 Set Position 96 Set to Material 10 Set Volume SubObject button 26 setUserProp 69 Shadow 113 Shadows 5 Shape 92, 94, 97, 107 Shapes 47 Shapes tab 33 Shear 30 showProperties 68 showProperties rbc 68

Index

125

Sim Edges 16 Sim Edges display option 15 Sim Edges menu option 4 Simple animation creating 59 Simple cloth creation 28 Simple fold stiffness 30 Simple force model 30 Simple fracture 54 Simple Friction resolver 77 Simple mesh 24 Simple test 91 Simulating a scene 10 Simulation 7, 16, 19, 20, 22, 24, 26, 28, 29, 33, 34, 38, 39, 42, 46, 47, 48, 49, 50, 56, 57, 60, 61, 62, 63, 69, 73, 75, 76, 78, 79, 81, 84, 86, 87, 88, 90, 92, 94, 95, 101, 107, 113 simulation 14 Simulation accuracy 11 Simulation frequency 89 Simulation geometries 14 Simulation geometry 14, 15, 22, 60 Simulation Geometry section 113 Simulation loop 88 Simulation menu 4 Simulation rollout 63 Simulation stability 96 Simulation step 60, 76, 89 Simulation structure 88 Simulation window 64 Skin 97 Skin mesh 62 Skin modifier 62 Skin-and-bone 111 Skin-and-bones 62 Sliding friction 10 Smashing object 81 Smooth Level option 24 Smoothing 21 Snap shot 85 Snapshot 87 Sofa object 95 Soft bodies 24 fixing 24 Soft body 21, 23, 25, 27, 45, 48, 49, 53, 61, 107, 113 assigning properties 21 creating 22 mass 22 properties 21, 22, 61 stiffness 23 Soft body collection 21, 22, 23, 24, 25, 113

adding objects 21 advanced options 24 creating 21 Soft Body modifier 24 Soft body simulation 33 Soft modifier 22 Soft object 97 SoftBody modifier 22 Solid 95 Solid geometry 96 Solidity 96 Solver 45, 113 Solving 7 Space 41, 102 Space warp 37 Space Warps menu 38 Spacebar 61 Specifying orientation 104 Speed 101 Sphere 93 spin axes 50 Spin Wheels 50 Spline 33, 34 Spline Select 34 Split angle 31 Spread angle 31 Spring 35, 42, 43, 44, 45, 76, 96, 106, 109, 114 act on compression 44 act on extension 44 adding 41, 42 compression 44 contraction action 42 damping 42, 44 extension 44 extension action 42 preview 44 properties 41, 42, 43 rest length 42, 44 stiffness 42, 44, 45 spring 41 Spring button 43 Spring forces 43 Spring Properties rollout 43 Stability 50, 76, 88 Stable Configuration 26 Stable stack 101 Stable state 89 Stack 96 Start Frame 60, 61, 63 Start frame position 61 Starting condition 81

126

Index

Starting orientation 103 State 85, 87, 88, 96, 101 Static friction 10, 105, 114 Statistical behavior 80 Step 88, 92, 97, 114 Stiffness 21, 23, 28, 30, 51, 61, 114 Strength 6, 45, 47, 51 Stretch 30 Subatomic 82 Sub-part 81 Substep 45, 64, 76, 88, 114 substep 89 Substep parameter 89 Substeps 24, 50, 60, 89 Substeps menu option 4 Substeps/Key value 60, 61 Substituting for optimization 16 Substituting geometry 15, 16 Substituting the geometry of an object with a proxy mesh 17 Substituting the geometry of an object with an optimized mesh 17 Surface 105 Surface Approximation rollout 32 Suspension 50, 51 System 12, 33, 42, 76, 77, 80, 86, 87, 88, 93, 96, 99, 106, 114 System resources 24 Systems Creating 3

Torque 104 Toy Car parameters 50 Toy car 41, 49, 114 mass 50 Toy Car option 50 Toy Car Orientation 50 Toy Car Properties 50 Transformation matrix 102 Treating an object as concave 16 Triangle 93 Triangles 96 Trivial rejection 91 Turning force 44 Typhoon 81

U
Ui/macroscripts subfolder 69 Unbreakable 57 Unit 75, 76, 78, 83, 101, 104 Universal joint 106 Unyielding body 59, 62, 77, 114 Unyielding object 62 Unyielding property 62 Unyielding Updates/Frame option 62 Update MAX 64 Update Max 32 Update MAX function 64 Update Max function 32 Update Max menu option 5 Update system 84 Update Viewports 61 Updates/Frame parameter 62 Use 16 Use Bounding Box option 16, 19, 109 Use Bounding Sphere 34 Use Bounding Sphere option 16, 19, 109 Use MAX Parameters 64 Use MAX Parameters menu option 5 Use Mesh Convex Hull option 16 Use Mesh option 17 Use Optimized Convex Hull option 16, 19 Use Optimized Mesh option 17, 19 Use Proxy Convex Hull option 16, 19 Use Proxy Mesh option 17, 19 User 92, 95, 96 User interface 68 User-defined properties 69 Using the original object mesh 16 Utilities command panel 9, 14, 16, 17

T
Targeted Camera icon 9 Terminology 79 Tessellation 38, 48 Test convexity 114 Test Convexity button 14, 114 Texture information 57 Texture quality 6, 114 Textures menu option 4 Thickness 34 Thumb 104 Time 80, 81, 86, 88, 98 Time interval 85, 87 Time period 86 Time scale 60 Time Scale value 55 Time step 86, 87, 88, 95, 97, 107 Timestep 24, 31, 45, 64 Toggle Display On/Off menu option 4 Toolbar symbols 2

Index

127

Utilities dialog box 2 Utilities panel 2 Utility panel 72

V
Variable 76, 87 Variance 53 Variance value 55 Vector 103 Vehicle 88 Vehicle crash test 79 Velocity 77, 81, 86, 88, 101, 105 Vertices 24, 25 Vertices option 48 view 8 View pane 43, 46, 54, 64 View panes 8, 10, 14, 16 Viewpane 35 Viewport 50 Viscosity 114 Visual effect 76 Visual geometry 99 Volume 93, 95 Volume button 26

Wind action 54 Wind force 85, 86 Wind speed 53 Wind strength 53 Wind symbol 55 Windmill 56 Wing 80 World 81, 85, 103, 104 world 24 World coordinate system 102 World reference frame 102, 103 World Scale 75 World scale 75, 76, 78 World Scale option 75 World Scale parameter 114 World space 24, 29, 45, 47, 50

Z
Zero mass 10

W
Wait time 80 Warping object 97 Water 37, 39, 53 adding 37, 38 animating 39 binding 37 density 37, 38 landscape 38 motion 39 parameters 38 resistance 39 ripple 38 setting properties 37 subdivisions 38 viscosity 39 wave speed 38 Water button 38 Water deformation 39 Water machine 107 Water space warp 37 Waves 37, 38 Weather vane 53 Weight 101, 105 Wheel axle axes 50 Wind 53, 81, 86

128

Index

S-ar putea să vă placă și