3dsmax 2010 Special Effects
3dsmax 2010 Special Effects
Special Effects
2010
Autodesk® 3ds® Max 2010 Software
© 2009 Autodesk, Inc. All rights reserved. Except as otherwise permitted by Autodesk, Inc., this publication, or parts thereof, may not be
reproduced in any form, by any method, for any purpose.
Certain materials included in this publication are reprinted with the permission of the copyright holder.
The following are registered trademarks or trademarks of Autodesk, Inc., in the USA and other countries: 3DEC (design/logo), 3December,
3December.com, 3ds Max, ADI, Alias, Alias (swirl design/logo), AliasStudio, Alias|Wavefront (design/logo), ATC, AUGI, AutoCAD, AutoCAD
Learning Assistance, AutoCAD LT, AutoCAD Simulator, AutoCAD SQL Extension, AutoCAD SQL Interface, Autodesk, Autodesk Envision, Autodesk
Insight, Autodesk Intent, Autodesk Inventor, Autodesk Map, Autodesk MapGuide, Autodesk Streamline, AutoLISP, AutoSnap, AutoSketch,
AutoTrack, Backdraft, Built with ObjectARX (logo), Burn, Buzzsaw, CAiCE, Can You Imagine, Character Studio, Cinestream, Civil 3D, Cleaner,
Cleaner Central, ClearScale, Colour Warper, Combustion, Communication Specification, Constructware, Content Explorer, Create>what's>Next>
(design/logo), Dancing Baby (image), DesignCenter, Design Doctor, Designer's Toolkit, DesignKids, DesignProf, DesignServer, DesignStudio,
Design|Studio (design/logo), Design Web Format, Discreet, DWF, DWG, DWG (logo), DWG Extreme, DWG TrueConvert, DWG TrueView, DXF,
Ecotect, Exposure, Extending the Design Team, Face Robot, FBX, Filmbox, Fire, Flame, Flint, FMDesktop, Freewheel, Frost, GDX Driver, Gmax,
Green Building Studio, Heads-up Design, Heidi, HumanIK, IDEA Server, i-drop, ImageModeler, iMOUT, Incinerator, Inferno, Inventor, Inventor
LT, Kaydara, Kaydara (design/logo), Kynapse, Kynogon, LandXplorer, LocationLogic, Lustre, Matchmover, Maya, Mechanical Desktop, Moonbox,
MotionBuilder, Movimento, Mudbox, NavisWorks, ObjectARX, ObjectDBX, Open Reality, Opticore, Opticore Opus, PolarSnap, PortfolioWall,
Powered with Autodesk Technology, Productstream, ProjectPoint, ProMaterials, RasterDWG, Reactor, RealDWG, Real-time Roto, REALVIZ,
Recognize, Render Queue, Retimer,Reveal, Revit, Showcase, ShowMotion, SketchBook, Smoke, Softimage, Softimage|XSI (design/logo),
SteeringWheels, Stitcher, Stone, StudioTools, Topobase, Toxik, TrustedDWG, ViewCube, Visual, Visual Construction, Visual Drainage, Visual
Landscape, Visual Survey, Visual Toolbox, Visual LISP, Voice Reality, Volo, Vtour, Wire, Wiretap, WiretapCentral, XSI, and XSI (design/logo).
Trademarks
The following are registered trademarks or trademarks of Autodesk Canada Co. in the USA and/or Canada and other countries: Backburner,
Multi-Master Editing, River, and Sparks.
The following are registered trademarks or trademarks of Moldflow Corp. in the USA and/or other countries: Moldflow MPA, MPA (design/logo),
Moldflow Plastics Advisers, MPI, MPI (design/logo), Moldflow Plastics Insight, MPX, MPX (design/logo), Moldflow Plastics Xpert.
clothfx™ is a trademark of Size8 Software, Inc. Havok.com™ is a trademark or registered trademark of Havok.com Inc. or its licensors. Intel is a
registered trademark of Intel Corporation. mental ray is a registered trademark of mental images GmbH licensed for use by Autodesk, Inc. All
other brand names, product names or trademarks belong to their respective holders.
Disclaimer
THIS PUBLICATION AND THE INFORMATION CONTAINED HEREIN IS MADE AVAILABLE BY AUTODESK, INC. "AS IS." AUTODESK, INC. DISCLAIMS
ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
FITNESS FOR A PARTICULAR PURPOSE REGARDING THESE MATERIALS.
Special Effects
9
This section covers a range of effects: liquid flowing through pipes, lens effects for a camera
image, even tumbling down a set of stairs! You will learn how to use particle systems, add
lens effects, as well as create many simulations using the reactor toolset.
1645
■ Changing particle shape and color based on test results
Introductory Tutorial
The best way to understand Particle Flow is by using it. This tutorial will
acquaint you with some of the basic methods of working with Particle Flow.
1 Start 3ds Max or, from the Application menu, choose Reset.
2 On the Create panel > Geometry category, click the drop-down list and
choose Particle Systems.
1 Press the 6 key to open Particle View. The particle source icon need not
be selected.
1. Event display
2. Particle diagram
3. Global event
5. Depot
Particle View is where you manage and edit the particle system. The main
window, known as the event display, contains the particle diagram, which
describes the particle system. The default system starts with a global event,
with the same name as the Particle Flow icon, followed by a birth event,
containing a Birth operator and several others that define the system's
initial properties. Each operator's name is followed by its most important
setting or settings in parentheses. Above the event display is a menu bar,
and below is the depot, containing all operators available for use in the
particle system. For more information about this dialog, see Particle View.
2 In the global event, PF Source 01, click the name of the Render 01
(Geometry) operator to highlight it and access its parameters. Be sure to
click the text area; clicking the icon simply toggles the operator's active
state.
Because this operator is in the global event, it affects the entire particle
system. Any operator you place here does likewise. For example, you can
define a global material here, or you can define different materials locally
in each event. For best results, don't combine global and local operators
of the same type in a single system; use one or the other.
The settings for the Render operator appear in a rollout on the parameters
panel, on the right side of the Particle View dialog. These include a
drop-down list for how particles are to render, the percentage of particles
that will render, and how to split up the particles into individual meshes.
3 In the birth event, Event 01, click the Display 01 (Ticks) operator at the
bottom of the list.
The display type is set to Ticks, as noted in the operator name in the
event.
4 Next to the Type label, click Ticks, and from the drop-down list, choose
Geometry.
1 In the depot at the bottom of the Particle View dialog, find Age Test. It's
the first item that uses a yellow, diamond-shaped icon.
3 Click the Age Test item in the list, and then in the Age Test 01 rollout
on the right side of Particle View, set Test Value=15 and Variation=0.
The test type is Particle Age, so this means that all particles that have
existed for more than 15 frames will test True, and be passed on to the
next event.
Next, you'll create a new event and wire it to the test.
4 From the depot, drag the Shape operator (“Shape”) to an empty part of
the event display, below Event 01.
5 Position the mouse cursor over the blue dot at the left end of the Age
Test's test output.
The cursor image changes to an icon depicting three arrows pointing
inward toward a circular connector.
6 Drag from the event output on the Age Test in Event 01 to the Event 02
input, and then release the mouse button.
TIP You can delete a wire (and anything else in the particle diagram) by
selecting it and pressing the Delete key. Feel free to try this now, but undo
any changes when you're finished.
7 Click the Shape 02 operator and set Shape=Cube. Also, click the Display
02 operator and set Type=Geometry.
1 Play the animation. Adjust the viewports so you can see the entire particle
stream, if necessary.
Summary
In this tutorial, you’ll use Particle Flow’s event-driven features to control the
flow of a simulated fluid substance (gas or liquid) through several branching
tubes. Arrows visualizing the direction and speed of the substance will be
animated as particles. As arrows approach branches in the tubes, they will
selectively change flow direction, and, ultimately, will change color as well.
You'll also learn how to use the BlobMesh compound object to simulate the
look of the fluid substance for rendering purposes.
1 On the Quick Access toolbar, click the Open File button, navigate
to the \scenes\dynamics_and_effects\mech_design folder and open the file
VizGasFlow_start.max.
The scene contains a branching tube object, named TubeStructure, set to
See-Through so that you can see objects inside the geometry in shaded
mode. It also contains three splines that define different paths through
the tubes. You’ll create a source for the particles to emit from on the left
side or entrance to the tube.
3 On the Emission rollout, set the Icon Type to Circle with a Diameter of
20.
In the Perspective viewport, you can see the PF Source icon displayed as
a circle with a logo and an arrow pointing outward from the center of
the icon.
1 With the PF Source icon selected, go to the Modify Panel and click the
Particle View button (or press the 6 key).
This opens the Particle View editor in its default arrangement, showing
the four main sections: event display, the parameters panel, the depot,
and the Description panel.
The event display is where you work with operators and events: the
components that define particle behavior in a Particle Flow system. The
default standard flow consists of a PF Source event and a generic event
that contains operators to define a standard stream of particles: Birth,
Position, Speed, Rotation, Shape, and Display.
2 In Particle View, open the Options menu and choose Track Update >
Particle Count.
A tab with numbers appears over each event. This is a useful method for
seeing how particles are moving through the events within your flow. If
you play the animation or drag the time slider, the tab updates with the
number of particles in each event. The global event (PF Source 01) shows
the total number of particles in the flow, which at this point is the same
number of particles as in Event 01.
Notice that each action in an event has some information listed in
parentheses next to the action name. This is a quick reference to the
action's settings. For example, the Birth operator reads: “Birth01 (0-30
T:200).” This means that it’s a Birth operator set to emit a total of 200
1 Right-click the Event 01 name (next to the light bulb icon), choose
Rename, and enter Emit Particles.
2 Click this event's Birth operator, and on the Parameters panel, change
the Emit Stop value to 600.
3 In the Emit Particles event, right-click on the Speed, Rotation, and Shape
operators and choose Delete.
2 In the Emit Particles event, right-click and choose Append > Operator >
Speed By Icon.
This adds a Speed By Icon operator to the bottom of the event.
3 Press H to open the Select From Scene dialog, choose the Speed By Icon
helper object, then from the 3ds Max main menu, choose Animation >
Constraints > Path Constraint.
If you move the mouse in the viewport, you can see a rubber-band dashed
line connecting the icon to the mouse cursor. The software is requesting
a path (spline) to follow.
4 In the viewport, click the spline running through the center of the main
tube (PathMain), or press H and then double-click PathMain.
7 In Particle View, click the Speed By Icon operator (named Icon Main),
then in the parameters panel Icon Animation group, make sure Event
Duration is active.
This will allow the particles to reference the animation of the icon
regardless of when they were emitted, as long as they are still contained
within the Emit Particles event.
The particles now appear as X shapes. Particle Flow uses this display
method to indicate an error when it is trying to display particles as
geometry, but there is no geometry to display. To resolve this, you'll
define the geometry for particles that are in the Emit Particles event.
2 From the depot, drag a Shape Instance operator into the Emit Particles
event. You can place it anywhere in the event, but be sure to drop it when
the blue line appears; if you drop it when a red line appears, you'll replace
the action under the mouse cursor.
3 Click the Shape Instance operator in the Emit Particles event, click the
Particle Geometry Object button (currently labeled “None”), and select
the ArrowMesh object in the scene.
The name “ArrowMesh” appears on the button.
You’ve now defined the ArrowMesh object to be the geometry all particles
will use within the Emit Particles event. Because you previously set the
Display operator to Geometry, you should now see ArrowMesh particles
when you play the animation. They’re too big and not aligned properly,
but both conditions are easy to fix.
To make the particles smaller, you could assign a Scale operator, or you
could just scale the ArrowMesh object itself, but Shape Instance includes
some scaling options to save you a step.
4 In the Shape Instance 01 operator parameters, make sure the Scale check
box is on, then set Scale % to 25.0.
5 Right-click the Emit Particles event and choose Append > Operator >
Rotation from the menu.
This adds a Rotation operator to the bottom of the Emit Particles event
that you can use to specify the orientation of particles in the event.
2 Right-click the Emit Particles event and choose Append > Test > Find
Target from the menu.
3 Click the Find Target operator and, from the drop-down list at the top
of the parameters rollout, choose No Control.
This disables most of the test's parameters.
When you created the Find Target test, it added a helper object to your
scene called Find Target 01. This is now the target for the particles within
this event; the software will test each particle based on its distance from
the helper object.
4 In the Find Target test parameters, set the Test True If Distance To option
to Target Pivot, and set the Is Less Than value to 5.0.
5 Right-click to the right side of the Emit Particles event in the blank space
of Particle View and choose New > Operator Event > Speed By Icon from
the menu.
You’ve created a new event containing a single operator. This is what
you will connect the output of the Find Target test to. But first you'll take
some simple but important organizational steps.
7 Move the mouse cursor to the left edge of the Find Target test, where the
nub is. When the cursor changes to horizontal black arrows, click and
drag the cursor to the right side of the Find Target test and release the
button.
You’ve given the new event a more descriptive name, and you’ve also
moved the output connector on the Find Target test operator to the
opposite side so that the wire can travel in a more direct path.
8 Click and drag from the small blue dot on the end of the test connector
to the input connector of the Flow North event. The result is a blue wire
connecting the Find Target test to the Flow North event.
1 In the parameters of the Speed By Icon operator in the Flow North event,
make sure Icon Animation > Sync By is set to Event Duration.
4 From the Animation menu, choose Constraints > Path Constraint and
complete the action by choosing the Path North spline as the path.
5 On the Motion Panel > Path Parameters rollout, turn on Path Options >
Follow and set Axis to Z.
7 Select the Icon Main helper object and slide its rightmost key to 150.
This effectively increases the speed of each icon along its path.
9 Turn on the Steer Towards Trajectory check box and set the Distance
value to 5.0.
TIP In addition to using Particle View, you can use the Modify panel to set
parameters for a Speed By Icon operator or a Find Target test if you select its
icon.
Because of the way the scene was originally set up, the Find Target icon
is created close to the correct position to determine whether particles
should switch to the upper tube. In the next step you'll move it upward
slightly, but in many cases you'll need to reposition the target by a greater
amount.
If you play the animation now, you see some of the arrows change
direction and move upwards along the second path. All of the particles
continue to point in the same direction because the Flow North event
doesn’t have a Rotation operator to define their orientation. To resolve
this, you could add another Rotation operator using identical parameters,
or you could instance the first one. Even better: All particles in this system
should point in the direction they’re traveling, so you can just move the
Rotation operator from the Emit Particles event to the global event.
11 Drag the Rotation operator from the Emit Particles event into the PF
Source 01 event. Be sure to drop it when you see a blue line, not a red
one.
This resolves the orientation issue. We still need to address some other
areas, but first you'll add one more path.
2 Select the Find Target 02 icon and then press ALT+A to access the Align
tool.
4 On the Align Selection dialog, turn on X Position (make sure Y and Z are
disabled) and set Target Object to Minimum. For Current Object, choose
Center. Click OK to close the dialog.
6 Connect the output of the second Find Target test to the Flow South
event.
7 In Particle View click the second Find Target test, set its mode to No
Control and set To Test True If Distance To: > Target Pivot to Is Less Than
5.0.
9 Select the Icon South helper object and use a Path constraint to attach it
to the Path South spline.
10 On the Motion Panel, turn on Path Options > Follow and set Axis to Z.
Also turn on Allow Upside Down.
This latter step helps to smooth out the motion when the particles are
moving directly downward.
11 In the track bar, slide the right-hand Position key to frame 100.
You now have icons moving down all three splines and particles following
them. You might want to adjust the locations of the Find Target icons
slightly so the particles branch properly.
Change colors:
What if you want to change the color of the arrows based on which path they
are moving along? This is a common need in AEC visualization when showing
how fluids move through pipes, with the colors differentiating the types of
fluid. Because you have a different event defining each path, it’s easy to assign
1 From the depot, drag a Material Static operator into the Emit Particles
event. Place it above the tests.
3 Open the Material Editor and drag the Red material onto the button
(“None”) on the parameters panel. Click OK to accept the Instance
method.
If you play or advance the animation in a shaded viewport, you can see
that all of the main particles are now red. The color of the particles in
the other events is determined by the Display operator in the global event.
2 Right-click the Emit Particles event and choose Append > Test > Speed
Test.
3 Highlight Speed Test 01 and set it to Test True If Particle Value > Is Less
Than Test Value. Change Test Value to 1.0.
By default, the Speed Test tests Velocity Magnitude, which is a fancy way
of saying “speed in any direction.” If necessary (not in this case), you can
make it more specific by testing velocity along a specific axis. By setting
it to “Less than 1” it will direct particles that slow to a stop to a new
event.
4 From the depot, drag a Delete operator into an empty area of the event
display to create a new event.
5 Rename the new event Delete Particles, and wire it to the output of the
Speed Test in the Emit Particles event.
6 Drag Speed Test 01 from the Emit Particles event to the bottom of the PF
Source 01 event.
The test's wiring (to the Delete operator) moves along with it.
Now every particle disappears as soon as it comes to the end of its path.
The only potential drawback with this method is a loss of flexibility. By
applying a test globally, all particles within the system, regardless of any
other parameters or conditions, will be tested for speed and sent to the
Delete Particles event. If you need to test for different conditions, you
can include the test in each event instead.
Apply BlobMesh
Suppose your goal is not so much an abstract visualization with arrow
indicators, but something more realistic. BlobMesh is a special compound
object in 3ds Max that you can use to simulate fluids. It works something like
the MetaParticles effect in the non-event-driven particle systems.
In this procedure, you'll use BlobMesh to simulate the flow of liquids in the
upper and lower tubes.
1 On the Create panel, choose Compound Objects > BlobMesh and click
in the viewport to create a BlobMesh object.
The BlobMesh object references objects in the scene, placing user-definable
metaballs at each vertex in the object. When of sufficient size and density,
the metaball’s surface features blend together to form a continuous blob.
You first have to assign an object for the BlobMesh to reference: in this
case, the particle system you’ve been working on during this tutorial.
2 With the BlobMesh object selected, go to the Modify Panel, click the Add
button in the Blob Objects group and choose PF Source 01 from the list.
This applies to the system as a whole, however, so next you'll define
which events to include in the blobby mesh.
3 Scroll down to the Particle Flow Parameters rollout and turn off the All
Particle Flow Events option.
If you scrub the time slider now, you'll see blobs forming around the
particles as they branch off into the north and south tubes. The flow
doesn't look very liquid because there aren't enough particles. If you like,
try increasing the Viewport % setting until you get enough particles for
the blobs to flow together. You can find this setting by clicking the PF
Source 01 event and then going to the parameters panel > Emission rollout
> Quantity Multiplier group.
You can find the final scene, without an increased Viewport % setting,
in the file VizGasFlow_finished.max.
An important consideration when using BlobMesh with Particle Flow is
that the size of the blob is determined by the size of the particles; the
BlobMesh Size parameter is ignored. You can see this by adjusting the
Scale value in the Shape Instance operator. In some cases you’ll need
greater quantities of smaller particles. But as you increase the volume of
particles, performance tends to decrease. This is because BlobMesh
analyzes the particles at every frame. For faster feedback during setup of
the particle system, you can turn on the BlobMesh Off In Viewport option
to restrict its calculations to render time.
Summary
Use a particle system for simulating the flow of gaseous or liquid substances
through pipes or tubing. With Particle Flow, use a Speed By Icon operator to
make the particles follow a path, and use a Find Target test to divert the flow
into different branches of the tubing. Use arrow-shaped particles to indicate
1 On the Quick Access toolbar, click the Open File button, navigate
to the \scenes\dynamics_and_effects\lens_flare folder, then open the file
tut_marsandsun.max.
3 On the Create panel, click the Cameras icon and click Target in
the Object Type rollout.
4 Click anywhere in the bottom left of the Top viewport, drag toward Mars,
and release.
2 From the Photometric drop-down list, choose Standard and from the
Object Type rollout, click Omni.
3 In the Top viewport, click to create an Omni light to the right and below
Mars. Name it marslight.
4 Create a second omni light to the right and above Mars. Name it Sun.
NOTE Both lights are adding illumination to the scene. With the camera in
front of Mars, the lighting of the sun doesn’t really add to the illumination
on the dark side of the planet. If this becomes a problem later, you can
exclude this light from illuminating any objects in the scene.
7 In the Modify panel, go to the Advanced Effects rollout > Affect Surfaces
group, and increase the Contrast setting for marslight to 77.0.
You won’t see the changes until you render the scene.
8 Activate the Camera viewport, then on the toolbar, click the Render
Production button.
You still don’t see the light that will be your Sun in the rendered image.
It won’t appear until you add effects in the next topic.
TIP Try different contrast values and render each one. The higher the value,
the sharper the edge of the light.
2 Go to the Modify panel and click the Atmospheres & Effects rollout title
to open it.
3 Click the Add button. The Add Atmosphere Or Effect dialog appears.
5 Click the Lens Effects name in the window and click Setup.
The Environment and Effects dialog appears.
TIP You should turn off Interactive when working in a complex scene, but
it’s useful for experimentation.
8 On the Lens Effects Parameters rollout, choose Glow in the list on the
left. Click the right arrow to move the effect into the list on the right.
After a brief delay, the light source appears as a glowing sphere in the
rendered frame.
9 Scroll down to the Glow Element rollout. In the Name field, enter Main
Sun.
To change the look of your Sun, try the following settings in the Glow
Element rollout:
■ Set Size to 50.0.
■ In the Circular Color group, set Mix to 50.0, giving the Sun a soft red
glow.
1 In the Effects tab of the Environment and Effects dialog, scroll up to the
Lens Effects Parameters rollout. Choose Ring and move it to the list on
the right. A ring appears around the Main Sun in the Effects Preview
window.
4 Turn on Glow Behind to place the glow from the Sun behind the planet.
Now the Sun looks more realistic.
1 In the Effects tab of the Environment and Effects dialog, scroll up to the
Lens Effects Parameters rollout. Choose Star from the effects list and move
it to the list on the right. A Star effect appears over the Main Sun in the
Effects Preview window.
■ Experiment with Width and Taper before setting them to 1.0 and 0.1,
respectively.
1 In the Camera viewport, move the Sun omni light so it’s just on the edge
of the planet.
Because Interactive is turned on, the rendered frame window updates
automatically.
2 Go to the Lens Effects Parameters rollout and select main sun from the
right-hand window.
3 Scroll down to the Glow Element rollout and set Occlusion to 0.0.
4 Return to the Lens Effects Parameters rollout and select Ring from the
effects list in the right-hand window.
5 Scroll down to the Ring Elements rollout and set Occlusion to 0.0.
2 In the Objects Properties dialog > G-Buffer group, change Object Channel
to 1 and click OK to close the dialog.
3 In the Environment and Effects dialog > Lens Effects Parameters rollout,
add another Glow to the list of effects.
5 Click the Options tab and in the Image Sources group, turn on Object
ID.
Notice that the number is set to 1 by default.
The planet now renders with a bright white glow. This is too intense.
6 Click the Parameters tab. Set Occlusion to 0.0 and turn off Glow Behind.
8 In the Radial Color section, change the white color swatch to a darker
brick red.
The planet is looking better now.
1 Experiment to see what happens when you change Size to 11.0, 22.0,
and 33.0.
As an additional exercise, try animating the effects' settings.
Summary
This tutorial has shown how to create Glow, Ring, and Star lens effects, and
how to adjust their settings. It also showed how multiple Glow effects can
create the effect of ambient lighting, how to create and navigate a camera
viewport, and the use of omni lights for scene illumination.
NOTE Move the box downward to make sure it is not touching the sphere.
NOTE If you don't have an object selected in the scene, or if you select an
item that cannot be used as a rigid body (such as a rigid body collection),
the dialog controls are unavailable.
The default value for Mass is 0.0, which means that the rigid body is fixed
in space during the simulation. However, in this example, the sphere is
going to drop onto the box, which will act as the floor in your simulation.
For this reason, you need to give the sphere a mass value.
You now have two objects with physical properties. However, your scene is
not yet valid for simulation. You must add the objects explicitly to the
simulation using a Rigid Body Collection.
1 Make sure no objects are selected, and then, on the reactor toolbar, click
Create Rigid Body Collection .
A Rigid Body (RB) Collection is a helper object that reactor uses to keep
track of the rigid bodies in your scene. It doesn't show up in renderings,
and its position has no effect on your scene.
4 Click Add. This opens a standard selection dialog that contains a list of
the remaining available rigid bodies in the scene.
TIP To remove a rigid body from the collection, highlight it in the Rigid
Bodies list and then click Delete.
5 From the list, choose the sphere, and then click Select to close the dialog
and add the sphere to the collection.
1 In the Left viewport, select the box and rotate it clockwise about
30 degrees, being careful not to let it touch the sphere.
Geometry Types
Simulation Geometry is the second rollout in the Rigid Body Properties dialog;
it deals with how objects are represented in the physical simulation.
In reactor, a convex object is one that has no holes or concavities in its surface.
For instance, a ping-pong ball is convex, but a golf ball is concave. Convex
objects are much easier to simulate than concave objects. For this reason,
when you simulate an object, it is treated as if it was convex by default, even
if the 3ds Max object is concave. To do this, reactor uses a special algorithm
to create a convex version of the object for simulation; however, the object
does not change in 3ds Max. This is called creating a convex hull for the object's
mesh, and is represented by the Mesh Convex Hull option on the Simulation
Geometry rollout of the Rigid Body Properties dialog.
However, there are times where you will want to simulate the exact mesh of
an object, concavities and all. You specify this using the Concave Mesh option.
In this section of the tutorial, you will specify that you want to simulate your
sphere as an exact sphere. This means that the sphere's geometry is not
simulated; instead, a mathematical sphere is used for simulation. This is not
only faster, but also more accurate (the object will roll perfectly smoothly)
and less memory-intensive than a simulation based on a geometry-based
sphere.
Continue using your scene from the previous lesson, or open
reactor_intro_3.max from \dynamics_and_effects\reactor\introduction.
5 At frame 0, select the sphere if necessary, and then Alt+click the sphere
and, from the quad menu > Set quad, choose Delete Selected Animation.
The sphere's keys on the track bar go away.
Geometry Simulation
In this lesson, you'll continue making a toy. The existing sphere acts as the
toy's body. The next step is to create a cylinder to act as the toy's arms. You'll
also create a duplicate of this cylinder and reduce its tessellation. You'll use
this simplified version, which is easier and faster to simulate, as the simulation
geometry for the first, more complex cylinder. This technique is known as
using proxy geometry.
NOTE If you were to make 20 copies of the first cylinder and add them to your
simulation, they would all use the simplified, duplicate cylinder as their simulation
geometry. This means you'd need only one instance of the cylinder geometry for
the physical simulation, thus reducing memory usage and increasing simulation
speed.
NOTE Continue using your scene from the previous lesson, or open
reactor_intro_4.max from \dynamics_and_effects\reactor\introduction\.
1 Create a cylinder in the Left viewport, and position it above your sphere.
2 On the Modify panel, set the following values for the cylinder: Radius=6.0,
Height=70.0, and make sure Sides is set to 18 (the default).
3 With the cylinder still selected, choose Edit > Clone. On the Clone
Options dialog, choose Copy and click OK.
You'll use this copy of the cylinder as the proxy geometry.
4 On the Modify panel, reduce the number of sides of the new cylinder to
12 and then move it away from the other objects.
5 Select the original cylinder and open the Rigid Body Properties dialog.
8 On the Simulation Geometry rollout, click the Proxy button, and then
select the cloned cylinder in one of the viewports.
The button now displays the name of your chosen proxy object.
9 Select the RBCollection helper object in your scene, and add the original
cylinder to it.
10 On the reactor toolbar, click Preview Animation and then play the
animation.
The cylinder doesn't roll as smoothly as its display would suggest.
11 In the preview window, choose Display > Sim Edges to display edges for
the objects’ simulation geometries.
The cylinder's simulation geometry is coarser than its display body.
1 Select the cylinder and move it down into the sphere, so that it resembles
a pair of arms.
2 Hold down Ctrl and select the sphere, adding it to your selection set.
The cylinder and sphere should be the only selected objects.
4 Select the RB Collection helper object, and add your new group to the
collection.
Making It Wobbly
The toy you are going to make will have a non-uniform mass distribution,
which, in this case, means that most of its mass will be centered about its
base. This will have the effect that the toy will not roll or fall over, but will
try to right itself, and will wobble around. This behavior is possible because
the primitives in a compound rigid body can have different masses. All you
have to do is add a small, heavy object inside the bottom of the toy and most
of its mass will reside there.
Continue using the scene from the previous lesson, or open reactor_intro_6.max
from \dynamics_and_effects\reactor\introduction.
1 First, complete the toy's geometry. Create a torus for its waistband, a
sphere for the head, two small spheres for eyes, and one for the nose.
2 Select the three spheres used for the eyes and nose and open the
Rigid Body Properties dialog.
4 Select the head of the toy and set its simulation geometry to Bounding
Sphere.
5 Once you have finished creating and arranging these objects, add them
to the toy_body group. For each object, select the object, choose Group
menu > Attach, and then click toy_body.
1 Select the toy_body group and choose Group menu > Open.
This allows you to select the individual primitives within the group to
edit their rigid body properties.
2 Change the mass of each object in the group (except the body and arms,
which already have mass values) to 1.0.
TIP You can do this quickly by selecting all of the objects in the group, and
setting the Mass to 1.0 on the Rigid Body Properties dialog.
You do this because you are going to add a heavy object to the group,
and it is this mass that you really want to affect the object's motion.
3 Click Preview Animation and you will see that all of the new objects
have been added to the compound rigid body.
The toy should fall, though it won't yet have the correct behavior. If the
object doesn't fall, you might not have given a mass to all of the objects
in the rigid body and, as a result, one of the primitives is fixed. To fix
this, close the preview window and check the mass of each of the objects
in the group.
4 Add a small box (Height, Width, and Length=3.0) inside the body sphere
and near the bottom of the object.
6 Select a component of the group and choose Group menu > Close to
close the group.
7 Select the small box, choose Group menu > Attach, and then click toy_body
to add the box to the group.
2 A display proxy must be a single mesh. To create this, first ungroup the
toy copy by selecting the new group and choosing Group menu >
Ungroup. Then select the copy's main body sphere.
4 In the Edit Geometry rollout of the Modify panel, click Attach List.
5 Use the Attach List dialog to select the rest of the objects that were part
of the group, and then click Attach.
You now have a single mesh representing the toy that you can use as a
display proxy.
TIP It is a good idea to label models in your scene clearly, especially when
they look similar to one another. In this tutorial, for example, you could
rename your proxy object toy_body_proxy.
6 Select your original toy_body group and choose Group menu > Open.
7 Select the group parent, which is the pink box surrounding the grouped
objects.
You need to select the group parent rather than any of the toy's
constituent objects, because the group parent represents the rigid body
and display proxies are applied to rigid bodies, not primitives.
8 Open the Rigid Body Properties dialog, and on the Display rollout,
turn on Proxy.
This activates the display proxy pick button.
9 Click the display proxy pick button and select the single-mesh version
of your toy in one of the viewports.
10 Hide the proxy object: Select the single-mesh toy, right-click, and from
the Display quadrant of the quad menu choose Hide Selection.
This will keep it out of your way.
11 Select a component of the group, and choose Group menu > Close,
then click Preview Animation.
Your toy will use the new mesh as its display object. If you make changes
to the editable mesh, these will be displayed whenever you use the preview
window.
NOTE You can continue using your file or you can open reactor_intro_8.max from
\dynamics_and_effects\reactor\introduction.
1 On the Utilities panel, click the reactor button and expand the
Preview & Animation rollout.
NOTE You can continue using your file or you can open reactor_intro_9.max from
\dynamics_and_effects\reactor\introduction.
1 In your scene (away from the other objects), create five boxes with Length
and Width=400.0, and Height=25.0.
5 In the Edit Geometry rollout of the Modify panel, click Attach List.
6 In the Attach List dialog, select the other four boxes, which make up the
sides of the toy box, and click Attach.
You now have a single mesh representing the toy box.
7 Open the Rigid Body Properties dialog and set the Simulation
Geometry property to Concave Mesh.
NOTE Make sure that the toy is not touching the box.
3 In a side viewport, Shift+Move the toy, and position the first copy above
the original.
NOTE Make sure that the copy is not touching the original toy.
6 Select all of the new toy objects and the toy box and click Select to add
them to the rigid body collection.
7 Click Preview Animation and let the toys fall into the box and settle.
9 Close the preview window and click in one of the viewports to update
the display. The toys will have been updated so that they have the
positions and rotations you updated in the preview window.
NOTE You can continue using your file or you can open reactor_intro_10.max
from \dynamics_and_effects\reactor\introduction.
3 Turn on Auto Key and move the time slider to frame 60.
Rotate the box clockwise by about 125 degrees so that the objects will
pour out when physically active. Turn off Auto Key. Be careful to move
your floor below the final position of the toy box so that the two are not
interpenetrating. This would not generate errors in simulation, but would
look strange.
NOTE Your toys may exhibit some strange behavior when you are
hand-animating the box, but don't be alarmed. This is because the objects
have not been keyframed yet. They will, however, behave correctly in the
preview window.
NOTE Remember that to change the physical properties, you must open the
group and change the properties of the group helper object. You can change
the properties of more than one object at a time.
Preparing Output
Now that you have your simulation behaving correctly, you need to create
keyframes for the objects’ motions. This can be done as before using the Create
Animation button on the Toolbox.
In this example, you will create keyframes for the first 100 frames of the
motion, and then simulate from frame 100 on. This shows how the reactor
dynamics functionality can extract initial velocities from the scene so that
simulating from frame 0 to 100 in one step is the same as simulating from
frames 0 to 20, then from 20 to 40, 40 to 60, 60 to 80, and finally 80 to 100.
NOTE You can continue using your file or you can open reactor_intro_11.max
from \dynamics_and_effects\reactor\introduction.
NOTE You can continue using your file or you can open reactor_intro_12.max
from \dynamics_and_effects\reactor\introduction.
1 On the Utilities panel > click reactor and expand the Preview
and Animation rollout.
2 In the Preview and Animation rollout, set Start Frame to 0 and End Frame
to 100.
4 Look at the animation again. As you can see, the behavior of the rigid
bodies in your scene is almost exactly the same as before the reduction
process, but the number of keyframes for each toy is greatly reduced. The
motion of the toys is still quite complex, but the file size has been reduced
about 30%.
In this tutorial, you have learned the basics of using reactor to create complex
animations:
1 Using the Rigid Body Properties dialog to set properties for objects in
your animation.
3 Previewing the animation, and converting the animation into 3ds Max
keyframes.
■ Preview animations.
■ Disable collisions.
■ Use Ragdoll constraints for hips and shoulders, back and neck.
■ On the Quick Access toolbar, click the Open File button, navigate to
the \scenes\dynamics_and_effects\reactor\ragdoll folder, then open
character.max.
A scene opens, containing a flight of stairs, a floor, and a character model.
As you can see, all of the bones are named so that their position in the
body is apparent; LCalf, RFoot, Head, etc.
3 On the Utilities panel > Utilities rollout, click reactor and open
the Properties rollout.
4 In the Physical Properties group > Mass field, assign a value of 10.0
kilograms to each object in your selection. In total, the character will
now weigh 170 kg. While this yields a nice final result, to add greater
1 With the Utilities rollout > reactor still selected, open the Havok 1 World
rollout.
The three values in the World rollout > Gravity area control the gravity
in your world (scene). The X, Y and Z components together form the
direction vector that represents gravity. Since gravity usually points
2 Choose Customize menu > Units Setup and switch the Display Unit Scale
to Metric.
The final step before you can simulate your scene is to add your objects to a
rigid body collection.
1 In the Create panel, click Helpers and select reactor from the
dropdown list.
4 In the Select Rigid Bodies dialog, select all of the scene objects except skin
and click Select.
The RB Collection Properties list should now look something like this:
2 On the Utilities panel, click reactor and expand the Preview &
Animation rollout, then click Preview in Window.
■ On the Create panel, click Helpers, and select reactor from the
drop-down list.
1 On the Create panel, click Helpers, and choose reactor from the
dropdown list.
■ Continue from the previous lesson or load the character01.max from the
\dynamics_and_effects\reactor\ragdoll directory.
Using a constraint is similar to the Rigid Body Collection, but this time you
add a Constraint Solver to the scene. Next you can begin to add various
constraint types to your objects and then add them to this solver. The solver,
in essence, figures out how best to keep all of your objects happy under the
conditions they've been given (body A connected to body B, body B connected
to body C, etc.).
1 On the Create panel, click Helpers and choose reactor from the
drop-down list.
Next, you'll specify the collection to which to apply the Constraint Solver.
4 With the solver selected, open the Modify panel > Properties rollout, and
click the button labeled None, below RB Collection.
5 Press H, choose RBCollection01 from the Pick Object dialog, then click
Pick.
Now you're ready to start connecting bones together, and soon will have your
rag doll tumbling down the stairs. You'll use the Hinge constraint to connect
the various bones in the character, first joining the right foot and calf bones
to simulate an ankle.
3 In the Modify panel > Properties rollout, click the button labeled None,
next to Child.
4 Press H, choose RFoot in the Pick Object dialog, then click Pick
The Child button should now read RFoot.
5 On the Modify panel > Properties rollout, turn on the Parent check box.
This indicates that you want to constrain two objects together, rather
than one object to the world.
7 Press H, choose RCalf from the Pick Objects dialog, then click Pick
The button beside Parent should now read RCalf and the scene should
look like this:
9 In the Limited group, set Min Angle to –20.0 and Max Angle to 30.0
■ The process for setting up the hinge constraint for each of the other bone
pairs is identical, with only the constraint limits differing. With this in
mind use this list to set the constraint parameters for each joint:
Con- Child Parent Min Max
straint Angle Angle
Name
1 Press H, choose CSolver01 from the Select From Scene dialog, then click
OK.
■ On the Utilities panel, click reactor, and then on the Preview &
Animation rollout, click the Preview in Window.
You might have noticed during the last preview that reactor complained that
some of the rigid bodies in the scene were interpenetrating. Although you
ignored this warning on that occasion, it's not a good idea to do in general.
Later in this tutorial, you will take care of this issue, but for now click Continue
and view the preview.
The first thing that stands out is that the bones connected with hinge
constraints stay together. This is exactly as planned, but notice that they
continue bouncing and dancing about once they hit the floor. This is because
reactor notices that the bones are interpenetrating with one another and tries
to separate them. However, at the same time, the Constraint Solver is trying
to keep them together. Since they are essentially battling with one another
over the position of the various bones they continue to bounce about
erratically. The solution to this is to tell reactor not to worry about
interpenetrations between the bones that you've connected.
1 On the Utilities panel > reactor > Collisions rollout > Global
Collisions group, click Define Collision Pairs.
2 Select all of (and only) the bone objects in the first column.
This displays a list of enabled collisions in the second column.
NOTE Instead of disabling all collisions between all limbs, you could instead
disable collisions between adjoining limbs. In order to do so, you would start
with all collisions enabled, select each adjoining pair (LHand and LForeArm,
Spine3 and Head, etc.) and click ">>" to disable just those pairs.
1 On the Utilities panel > reactor > Preview & Animation rollout,
click Preview in Window.
Press P to view the animation.
The Rag Doll constraint provides three axes of importance: the Twist Axis, the
Plane Axis, and the Twist x Plane Axis. The twist axis is probably the easiest
to visualize and you can do so by simply stretching out your arm and rotating
it so that your thumb changes from pointing upwards to downwards. Your
movement is just a series of rotations along the twist axis of the shoulder and
elbow. In general, the twist axis should follow the length of the child body
in a joint. In reactor you can specify how far on either side of neutral the
constraint can twist; this need not be symmetric.
The other two axes are interlinked and together the control the allowed volume
that the child body can occupy. So first you'll have a look at the cone angles
that allow you to specify the volume that the child may move through:
If you imagine the constraint representing your shoulder, the green volume
is the range of allowed positions that your upper arm may occupy. However,
you can refine the allowed volume further by using the plane axis to enforce
plane limits. These limits are used to generate two further cones:
This allows you to create two different scenarios; one where the cones
generated by the plane limits intersect with cone produced by the cone angles
and the one where they do not:
If the volumes do not intersect, the plane limits do not have any effect in the
constraint; however, by allowing the cones to intersect, and deeming the
overlapping volume as invalid body positions, you can limit the allowed
positions for the child body further still.
These are the parameters that you will be adjusting in reactor to tweak the
behavior of the character. Hopefully this brief overview will help clarify Rag
Doll constraints a little for you.
■ You can either continue from where you left off or load character02.max
from the \dynamics_and_effects\reactor\ragdoll directory.
1 On the Create panel, click Helpers and choose reactor from the
drop-down list.
4 On the Modify panel > Properties rollout, click the button labeled None,
next to Child.
6 Turn on Parent.
This tells reactor to constrain two bodies together.
8 Press H, choose Pelvis from the Pick Object dialog, then click Pick.
The button beside Parent should now read Pelvis and the scene should
look like this:
Next, you need to adjust the Rag Doll constraint limits so that it behaves
like a real hip joint:
9 In the Modify panel > Properties rollout > Limits group, set Twist Min to
–5.0 and Twist Max to 5.0.
■ The table below gives a list of the constrained bodies, the constraint name
and the constraint parameters. Use this table to set up the remaining Rag
Doll constraints in your scene.
Constraint Child Par- Twist Twist Cone Cone Plane Plane
Name ent Min Max Min Max Min Max
Once you've created all of the above constraints your Rag Doll constraints
should look like this:
3 Select all the objects (Rag Doll constraints) and click Select.
Now the Constraint Solver has all of the constraints in it and the scene
is ready to preview once again. First, save your scene.
1 On the Utilities panel > reactor > Preview & Animation rollout,
click Preview In Window.
1 Press H, choose the skin, the floor, and all 16 steps on the Select From
Scene dialog, then click OK.
1 On the Utilities panel > reactor > Preview & Animation rollout
> Timing, set End Frame to 360.
And that's a wrap! It's up to you now to tweak the various parameters on the
rag doll to alter its behavior as it tumbles down the stairs. You may find some
joints are too loose or tight: reduce or increase the limits accordingly. You can
give both halves of the rag doll's body different settings to encourage it to fall
in a given direction. Try changing its initial position and orientation or add
some obstacles on the stairs.
You can see the final result of this tutorial by opening characterEnd.max from
the \dynamics_and_effects\reactor\ragdoll directory.
Summary
You can use the reactor constraints to hold a character together, and control
how it behaves during falls, collisions, and other physical encounters.