Controlling Particles with Particle Flow


The Particle Flow Source option in the Create image from book Particles menu is more than just a new particle system: It is a whole new interface and paradigm that you can use to control particles throughout their life. This is accomplished using the Particle View window where you can visually program the flow of particles.

The Particle View window

The Particle View window, shown in Figure 35.19, is opened by clicking on the Particle View button in the Setup rollout when a Particle Flow Source icon is selected or by pressing the keyboard shortcut, 6. Pressing 6 opens the Particle View window even if its icon isn't selected.

image from book
Figure 35.19: The Particle View window lets you program the flow of particles using a visual editor.

The Particle View window is divided into four panes. The Event display contains all the event nodes. These nodes contain individual actions, and nodes can be wired to one another to define the flow. The Parameter pane in the upper-right corner displays the parameters in rollouts for the action selected in the Event display. The Depot pane is below the Event display pane and contains all the possible actions that can work with particles. In the lower right is a Description pane that offers a brief description of the action that is selected in the Depot pane. Except for the Event display pane, you can turn off the other panes using the Display menu.

In the lower-right corner of the window are several display tools. These tools can be used to navigate the Event display. The Display tools include Pan, Zoom, Region Zoom, Zoom Extents, and No Zoom. The No Zoom button eliminates all zooming and displays the nodes at their normal size.

Tip 

With the Particle View window open, you can Pan the Event display by dragging the scroll wheel on the mouse.

The Standard Flow

When the Particle Flow Source icon is created and the Particle View window is first opened, two nodes appear in the Event display. These nodes are called a Standard Flow. These two nodes identify the Particle Flow Source and are wired to an event node containing a Birth action. The Birth action defines when particles Start and Stop and the Amount or Rate. You can change these values by selecting the Birth event in the Event display and changing its parameters in the rollout that appears in the Parameters pane.

Several other default actions appear in this default event node, including Position Icon, Speed, Rotation, Shape, and Display. Each of these events has parameters that you can alter that appear in the Parameters pane when the action is selected, and each event and action is identified with a number (such as 01) that appears next to its name. Each new event or action gets an incremented number. You can also rename any of these events if you right-click on the event and select Rename from the pop-up menu.

A new Standard Flow can be created using the Edit image from book New image from book Particle System image from book Standard Flow menu command. An Empty Flow includes only the PF Source node. When a new Standard Flow (or Empty Flow) is created in the Particle Flow window, a PF Source icon is added to the viewports. And if the PF Source icon is deleted in the viewports, the associated event nodes are also deleted in the Particle Flow window.

Working with actions

The Depot pane includes all the different actions that can affect particles. These actions can be categorized into Birth actions (identified with green icons), Operator actions (identified with blue icons), Test actions (identified with yellow icons), and Miscellaneous actions (which are also blue). Each of these categories can also be found in the Edit image from book New menu.

New events can be dragged from the Depot pane to the Event display. If you place them within an existing node, a blue line appears at the location where the action will appear when dropped. The particles are affected within a node in the order from top to bottom in which they appear. If a new action from the Depot is dragged over the top of an existing action in the Event display, a red line appears on top of the existing action. When you drop the new action, it replaces the existing action.

Actions can also be dropped away from an event node, making it a new event node. If an event is a new node, then you can wire certain actions that are tested as true. For example, if you have a set of particles with a random speed assigned, then you could use a Test event to determine which particles are moving faster than a certain speed and wire those particles to change size using the new event node.

Clicking on the action's icon disables the action. Table 35.1 provides a complete list of actions and their descriptions.

Table 35.1: Particle View Actions
Open table as spreadsheet

Toolbar Button

Name

Description

image from book

Empty Flow

Creates an emitter icon, but includes no actions

image from book

Standard Flow

Creates an emitter icon wired to an event that includes default actions including Birth, Position Icon, Speed, Rotation, Shape, and Display

image from book

Birth

Emits particles and defines the start, stop, and amount or rate

image from book

Birth Script

Emits particles based on a script

image from book

Delete

Removes particles from the flow, either All, Selected, or by Age

image from book

Force

Adds and subjects particles to Space Warp forces

image from book

Keep Apart

Prevents particle collisions by controlling particle speed

image from book

Mapping

Defines the mapping coordinates for the particles

image from book

Material Dynamic

Assigns material to a particle that can change during the life of a particle

image from book

Material Frequency

Assigns materials to subobjects based on defined amounts per Material ID

image from book

Material Static

Assign a material to a particle that is constant for the event

image from book

Position Icon

Defines the particle's position relative to the emitter icon

image from book

Position Object

Defines the particles position relative to a scene object that acts as an emitter

image from book

Rotation

Defines the rotation of the particles

image from book

Scale

Defines the scale of the particles

image from book

Script

Allows the particles to be controlled with a script

image from book

Shape

Defines the shape of the particles; options include Vertex, Tetra, Cube, and Sphere

image from book

Shape Facing

Causes the particles to always face the camera's view; lets you select a camera or object to look at

image from book

Shape Instance

Allows the particle to be a separate scene object

image from book

Shape Mark

Creates a spot mark on a specified contact object

image from book

Speed

Defines the speed of the particles

image from book

Speed By Icon

Causes the particles to follow the trajectory of the viewport icon

image from book

Speed By Surface

Sets the speed of a particle based on an object's surface normals or to be parallel to its surface

image from book

Spin

Defines the amount of spin and the axis about which the particle spins

image from book

Age Test

Tests for the particle's age or its age in the current event

image from book

Collision

Yields true if the particle collides with a selected deflector object

image from book

Collision Spawn

Yields true if the particle collides with a selected deflector object; new particles are then spawned

image from book

Find Target

Yields true if the particle is within the specified threshold of the target icon

image from book

Go To Rotation

Yields true when the current rotation action ends and transitions to the next rotation

image from book

Scale Test

Yields true if the particle is scaled to a specified size

image from book

Script Operator

Tests the particles based on a script

image from book

Send Out

Sets all particles to true and moves them to the next event

image from book

Spawn

Creates new particles and moves them to the next event

image from book

Speed Test

Yields true if a particle exceeds a specified speed

image from book

Split Amount

Sends a fraction or every nth particle to the next event

image from book

Split Selected

Yields true if particle is selected

image from book

Split Source

Yields true based on the particle's origin emitter

image from book

Cache

Records particle positions for quicker viewport playback

image from book

Display

Defines how the particles are displayed in the viewports

image from book

Notes

Allows notes to be added to the event node

image from book

Render

Defines how the particles are rendered

Tutorial: Creating an avalanche

One of the cautions that come with particles is that if you're not careful, you can quickly spawn enough particles to bring any system to its knees. Using the particle spawn feature is one of the worst offenders. For this tutorial, we use a Collision Spawn action to create an avalanche, but we must be sure to keep the number of spawned particles in check.

To use Particle Flow to make an avalanche effect, follow these steps:

  1. Open the image from book Avalanche.max file from the Chap 35 directory on the DVD. This file includes a simple hillside covered with snow.

  2. Select Create image from book Space Warps image from book Deflectors image from book SomniFlect, and drag in the Top viewport to create a spherical deflector that covers the entire hill. Click the Select and Scale tool, and in the Z-axis, scale the SOmniFlect sphere down in the Left viewport until it is roughly the same thickness as the hill object. Then rotate the SOmniFlect until it is aligned parallel to the hill.

  3. Select Create image from book Particles image from book Particle Flow Source, and drag in the Top viewport to create the emitter icon. Scale and rotate the emitter icon so it is positioned inside the SOmniFlect object on the uphill side pointing downhill.

  4. Click the Particle View button in the Command Panel to open the Particle View window (or press 6). Select the Shape01 action, and set the Shape to Sphere and the Size to 5.0. Select the Speed01 action, and set the Speed value to 100. Click the colored dot to the right of the Display01 action, and select white as the new color.

  5. Select the Collision Spawn action from the Depot pane, and drop it in Event01 beneath the Display01 action. Then select the Collision Spawn action, click the By List button in the Parameters pane, and select the SOmniFlect object. Then disable the Test True for Parent and Spawn Particles option, enable the Spawn On Each Collision option, and set the Offspring value to 10.

Figure 35.20 shows an avalanche of snowballs as it rages down a snowy hillside.

image from book
Figure 35.20: Using the Collision Spawn and a well-placed deflector, you can create an avalanche effect.

Using Particle Flow helpers

In addition to the Standard Flow event, several other actions create icons in the viewports that are controlled using the action parameters. One of these helpers appears when the Find Target action is added to an event node. This helper is a simple sphere, but all particles in the scene are attracted to it. It can also be animated.

The Speed By Icon action creates an icon that forces particles to follow its trajectory path.

Wiring events

Each new event node that is created has an input that extends from the upper-left corner of the node, and each Test event that is added has an output that extends to the left of its icon, as shown in Figure 35.21. Test action outputs can be wired to event inputs by dragging from one to the other. The cursor changes when it is over each.

image from book
Figure 35.21: Event outputs can be wired to event inputs.

Once wired, all particles that are tested to be true are transferred to the new event node and are subject to the actions in the wired event node.

Tutorial: Moths chasing a light

Another cool feature that the Particle Flow interface makes available is the ability to have particles chase a target object. In this example, we use the Target event to make some annoying bugs follow a lantern's light.

To use Particle Flow to make several bugs chase a light, follow these steps:

  1. Open the image from book Moths chasing light.max file from the Chap 35 directory on the DVD.

    This file includes a simple lantern created from primitives that is suspended from a chain and animated rocking back and forth. The file also includes a simple moth.

  2. Select Create image from book Particles image from book Particle Flow Source, and drag in the Front viewport to create the emitter icon. Click the Particle View button to open the Particle View interface.

  3. In the Event01 node, select the Birth01 action and set the Emit Stop to 100 with an Amount of 50.

  4. Drag the Position Object action from the Depot pane, and drop it on top of the Position Icon action to replace it. Select the new Position Object action, click the By List button under the Emitter Objects list in the Parameters pane, and select the Sphere01 object.

    This sphere surrounds the lantern and is the source of the moths. It has a material with an Opacity setting of 0 applied so that it is not visible in the scene.

  5. Select the Rotation action in the Event01 node, and change the Orientation Matrix option to Speed Space Follow.

    This rotates the moths as they follow the swinging lantern.

  6. Drag the Shape Instance action from the Depot pane, and drop it on top of the Shape action to replace it. Select the new Shape Instance action, click the Particle Geometry Object button in the Parameters pane, and select the moth object in the viewports.

  7. Drag the Find Target action from the Depot pane, and drop it at the bottom of the Event01 node. This adds a new Find Target icon to the viewports. Select the Find Target icon in the viewports, and move it to the lantern flame's position. Select Group image from book Attach, and click the lantern object to add the Find Target icon to the lantern group. This makes the target move with the lantern. Enable the Use Cruise Speed option, and then set the Speed to 1000 with a Variation of 50 and the Accel Limit to 5000 with an Ease % of 50. You also need to enable the Follow Target Animation option.

  8. Drag the Material Dynamic from the Depot pane to the Event Display pane, and drop it outside the Event01 node to create a new node called Event02. In the Parameters pane, enable the Assign Material button and click the material button. Select the Flash material from the Material/Map Browser (select the Material Editor option to see the sample slot materials).

  9. Drag the Age Test action from the Depot pane, and drop it below the Material Dynamic action. Then select Event Age from the drop-down list in the Parameters pane, and set the Test Value to 2.

  10. Finally, drag the Delete action from the Depot pane, and drop it away from the other events. Then wire Event02 to the new event node, and select the Selected Particles Only option in the Parameters pane.

Figure 35.22 shows several moths eagerly pursuing the swinging lantern.

image from book
Figure 35.22: All the moths in this scene are particles and are following a target linked to the lantern.

Debugging test actions

Any test action can be made to return a True or False value if you click the left (for True) or right (for False) side of the test action's icon in the Particle View interface. This lets you debug the particle flow. Tests set to be true show an icon with a green light, and tests set to be false show a red light icon.

Tutorial: Firing at a fleeing spaceship

Well, it is about time for a space scene, and we all know that lots of particles float around out in space-stars, asteroids, comets, and so forth. It's all great stuff to animate. For this scene, we use the Particle Flow feature to fire laser blasts on a fleeing spaceship.

To use Particle Flow to fire on a fleeing spaceship, follow these steps:

  1. Open the image from book Fleeing spaceship.max file from the Chap 35 directory on the DVD.

    This file includes a spaceship model created by Viewpoint Datalabs that has been animated as if it were fleeing.

  2. Select Create image from book Particles image from book Particle Flow Source, and drag in the Front viewport to create the emitter. With the Select and Move (W) button selected, move the emitter until it is aligned with the end of the laser gun. Then click the Select and Link button, and drag from the emitter to the gun object to bind the emitter to the gun.

    The emitter now moves with the animated laser gun.

  3. With the Particle Flow Source icon selected, open the Modify panel and click on the Particle View button in the Setup rollout (or press the 6 key) to open the Particle View interface.

  4. In the Event01 node, select the Birth 03 event; in the Parameters panel, set the Emit Stop to 100 and the Amount to 50. This produces a laser blast every two frames. Click the blue dot in the lower-right corner of the Event node, and select a red color from the Color Selector that appears.

  5. Select Create image from book Standard Primitives image from book Cylinder, and drag in the Front viewport to create a Cylinder object. In the Hierarchy panel, select the Affect Pivot Only button and rotate the Cylinder's Pivot Point until its Y-axis points at the spaceship. Then in the Particle View window, drag the Shape Instance event from the depot and drop it on top of the Shape event in the Event 01 node. This replaces the Shape event with a Shape Instance event. In the Parameters rollout, click the Particle Geometry Object button and select the Cylinder object. Select the Rotation event, and delete it with the Delete key.

  6. Select Create image from book Space Warps image from book Deflectors image from book SOmniFlect, and drag in the Top viewport to create a spherical deflector that encompasses the spaceship. Click the Select and Non-Uniform Scale button, and scale the X- and Z-axes until the deflector just fits around the spaceship. Then link the deflector Space Warp to the spaceship.

  7. In the Particle View window, drag the Collision event from the depot to the bottom of the Event 01 node. In the rollout, below the Deflectors list, click the Add button and select the SOmniFlect01 object surrounding the spaceship.

  8. Drag a Spawn event from the depot to the event display, and then connect the Collision event by dragging from its output to the input of the new Spawn event. Then click the color for the new event particles, and change it to orange. Select the Spawn 01 event, enable the Delete Parent option, and set the Offspring to 200 and the Variation % to 20. Then set the Inherited % to 50 with a Variation of 30.

  9. Drag the Delete event to the bottom of the Event 02 node, select the By Particle Age option, and set the Life Span to 20 and the Variation to 30. Drag a Shape event to the Event 02 node, and set the Shape to Sphere and the Size to 0.5.

  10. Finally, click the Play button to see the resulting animation.

Figure 35.23 shows the final Particle View flow, and Figure 35.24 shows a frame of the animation in the viewport. You can still do several things to improve this animation, such as adding a Glow Render Effect to the laser blasts and using the Particle Age material with some transparency to improve the explosion's look.

image from book
Figure 35.23: The Particle View window shows the flow of the particles in the animation.

image from book
Figure 35.24: The spaceship is trying to outrun the laser blasts.

Tutorial: Creating a black hole using Particle Flow

Particle systems are one of the best sources for special effects, and with the Particle Flow interface, you can control them more easily. In this tutorial, we create an array of particle systems and have all their particles flow together to form a black hole.

To create a black hole using the Particle Flow interface, follow these steps:

  1. Select Create image from book Particles image from book Particle Flow Source, and drag in the Left viewport to create the icon. The icon's direction arrow should point to the right in the Top viewport. With the icon selected, click the Affect Pivot Only button in the Hierarchy panel and move the icon to the origin location in the Top viewport. Then click the Affect Pivot Only button again to disable pivot mode.

  2. Select Create image from book Standard Primitives image from book Sphere, and create a small sphere in the Top viewport at the grid origin in the center of the viewport.

  3. Click the Auto Key button at the bottom of the interface, and drag the Time Slider to frame 100. Then select the sphere object in the Left viewport, and move it downward a little. Then select the Particle Flow Source icon in the Top viewport, and rotate it about 60 degrees. Then disable the Auto Key button to leave key mode.

  4. With the Particle Flow icon selected, click the Particle View button in the Modify panel (or press the 6 key) to open the Particle Flow window. Select the Birth event, and change the Emit Stop value to 100 and the Amount to 200. Select the Shape event, and change the Shape to Sphere and the Size value to 2.0. In the Display event, change the Visible % to 10.

  5. Drag the Speed by Surface event from the Depot window, and drop it on top of the Speed event in the Event node. Select the Control Speed Continuously option from the drop-down list, enable the Speed option, and set the Speed value to 100 and the Speed Variation to 20. Then click the Add button, and select the small Sphere object in the Top viewport or you can select the sphere from a dialog box using the By List button.

  6. Select the Particle Flow icon; with the Shift key held down, rotate the icon about 52 degrees and enter 6 for the Number of Copies in the Clone Options dialog box that appears.

This creates particle flow icons that surround and feed the black hole.

Figure 35.25 shows the resulting black hole with no materials or Render Effects applied after the Particle Amount is set to 500. For materials, I recommend using the Particle Age map along with a high Self-Illumination value and a Glow Render Effect.

This same structure can be modified to produce a tornado or hurricane.

image from book
Figure 35.25: One spiraling black hole accomplished with the Particle Flow interface




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

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