Box#2 Operator & Test Basics

by John Rand

This section will briefly explain Box#2 basic operator & test placement within a flow, as well as some basic functionality.

Each example has a list of the Box#2 Operators & Tests used, links to the online documentation for the operators, and its own simplescene. The examples are limited to the minimum required operators and/or tests allowing you to easily dissect and study.

Example 1 - Multi Event Interaction

Example 2 - PhysX Force Simple Explosion

Example 3 - Collision and Pile Up

Example 4 - Binding Beads with PhysX Glue

Example 5 - Dissolving Glue with Solvent

Example 6 - Levitation with Anti-Gravity

Example 7 - Knocking Down a Wall


Example 1 - Basic Setup - Birth Grid, PhysX Shape and PhysX World.

Scene File: Max9_Box2Basics_Sample1.max

 

The minimum usage of Box#2 requires two operators PhysX World and PhysX Shape.

When using Box#2 Operators and Tests, the most important thing to remember is the location of the PhysX World operator. Note that every operator resides in a hierarchal order.

All PhysX Operators define properties for your PhysX particles. For instance, if you were to put the PhysX Shape below the PhysX World, the PhysX World would not "see" the PhysX shape properties as defined by the PhysX Shape operator. Every operator is evaluated in the order it is placed in the Flow, from Top to Bottom.

The PhysX World Operator is the heart of all Box#2 operations. In order to apply Box#2 PhysX to multiple Events it needs to have a PhysX World Operator that uses the same PhysX World Driver.

This two event example uses a Birth Grid and a Birth Stream.

Notice both Events are wired to the same Global node. In order for separate event birthed particles to interact they need to be linked to the same PF Source node.

 


Example 2 - Basic Setup - Birth Grid, PhysX Shape, PhysX Force, PhysX Drag, and PhysX World.

Scene File: Max9_Box2Basics_Sample2.max

Back to Top

This example uses PhysX Force and PhysX Drag to simulate an simple explosion. The PhysX force is placed below the shape operator, which is its proper placement since you need a geometric shape to be able to define the force that is being applied. The same rule applies for the PhysX Drag operator.

Brief description of the flow:

This flow is built off of a PhysX Flow Preset. The Birth grid was altered using the "Icon Size" settings to give the appearance of a layer ground plane.

The shapes are simple cubes that were scaled down on the Z-axis with a Scale Operator.

The only change made to the PhysX Shape operator was to the Mass parameter. It is per shape and set to 100.0 world units. This gives each particle a mass of 100 units.

The PhysX Force Operators set to emit a pulse of wind for 2 frames, to emulate and explosive force. This is achieved by checking the "Impulse on Event Entry" Checkbox and setting the frame duration.

The PhysX Drag creates drag similar to a Drag Space Warp, although this version is optimized for the use with the PhysX World Driver. It settings are quite high only to show you its effect on the simulation.

 

The render below is a side-by-side comparison of the flow with and without the use of drag.

NOTE: The PhysX Drag is exaggerated to show the effect.

 

 


Example 3 - Basic Setup - Birth Stream, PhysX Shape, PhysX World, and PhysX Collision.

Scene File: Max9_Box2Basics_Sample3.max

Back to Top

This example uses a Particle Flow Collision Shape WSM modifier in conjunction with the PhysX Collision Test for a simple collision and pile up of particles.

NOTE: All PhysX Tests must reside below the PhysX World operator.

In order for scene objects to interact with the Particle Flow PhysX operators you must add a PFlow Collision Shape Modifier to your scene geometry. As seen here:

With the PFlow Collision Shape Modifier added to the scene geometry it is now possible to add it to the PhysX Collision Test

Brief description of the flow:

A stream of particles is born using the Box#2 Birth Stream.

The PhysX Shape operators is set to Type Sphere, the Static and Dynamic Friction are set to 20.0 and the rest of the parameters are at default. With higher friction particles interact more like sandpaper as opposed to glass.

The PhysX World is set to default. For a more accurate simulation you can raise the sub frame factor under the PhysX World Driver Advanced rollout in the modify panel.

 

The use of a standard Spin operator gives the particle an initial amount of spin before the simulation takes over. You can use other standard operators in the position as well.

The PhysX Collision test has the Box01 scene object added to its list box. Verifying that the box has been included in the simulation.

 

 

and the result:

 

 


Example 4 - Basic Setup - Birth Stream, PhysX Shape, PhysX World, and PhysX Glue.

Scene File: Max9_Box2Basics_Sample4.max

Back to Top

PhysX Glue the universal particle binding agent. As with all PhysX Tests, PhysX Glue needs to reside below the current events PhysX World operator, and the Maxscript listener will tell you if you have placed it incorrectly.

The example is creating a string of beads created with a Birth Stream that are being bound together at birth with a PhysX Glue Test.

Brief description of the flow:

A stream of particles is born using the Box#2 Birth Stream.

The PhysX Shape operators is set to Type Sphere and the rest of the parameters are at default.

The PhysX World is set to default. If you want your Particle Glue bindings to be more rigid you can raise the sub frame factor under the PhysX World Driver Advanced rollout in the modify panel. As seen below:

The PhysX Glue test is set to Simplified and Continuous. Simplified is the fastest bind solver. Continuous enables Glue to constantly create new binds as particles are born. Switching this to On Event Entry will still bind particles just not as consistently. Since new particles are being created throughout the duration of the animation so you must also create new binds.

This is the result without Physx Glue binding and with PhysX Glue binding:

 

 


Example 5 - Basic Setup - Birth Grid, PhysX Shape, PhysX Solvent, PhysX World, PhysX Collision, and PhysX Glue.

Scene File: Max9_Box2Basics_Sample5.max

Back to Top

The PhysX Solvent operator is a companion to PhysX Glue. PhysX Solvent is an easy way to break glue bindings without using the Breakability parameters in PhysX Glue, although it is still possible to use the Breakability parameters in conjunction with PhysX Solvent. The PhysX Solvent placement may reside in the current PhysX Glue event above the PhysX World or in a new event above the PhysX World. The PhysX Solvent has numerous ways to break binds, see the PhysX Solvent Help index for a full listing. The example uses the Solve By Icon method.

We are also using a PhysX Collision Test in this simulation.You can place the PhysX Collision Test above or below the PhysX Glue Test but it must be below the PhysX World Operator.

NOTE: It is possible to for PhysX Glue to bind to PFlow Collision Shape Modifier objects.

Brief description of the flow:

This flow is built off of a PhysX Flow Preset. The Birth grid was altered using the "Icon Size" settings to give the appearance of a layer ground plane.

The shapes are simple cubes that were scaled down on the Z-axis with a Scale Operator.

The PhysX Shape operator is set at default.

The PhysX Solvent operator is set to dissolve binds by Icon. It is also set to Slice. This means when a bind passes the "skin" of the icon it will dissolve the bind so two particles one outside the icon volume and one inside the bind will dissolve. Volume the whole bind need to reside within the volume of the icon to dissolve.

The PhysX Collision for providing a more interesting simulation. It is not necessary for use with PhysX Solvent. You can if you wish add the Sphere01 collision object to the PhysX Glue Deflectors list and activate for a different result.

The PhysX Glue test, however, is necessary for a simulation using Solvent, for without Glue there is no need for Solvent. The test is set to bind the Birth Grid particle together to create a layered plane similar to Example 2.

 

The resulting animation without and with PhysX Solvent.

 

 


Example 6 - Basic Setup - Birth Stream, PhysX Shape, PhysX Force, and PhysX World.

Scene File: Max9_Box2Basics_Sample6.max

Back to Top

The PhysX Switch Operator can used to turn off certain aspects and/or the whole simulation of the PhysX World Driver. This example use a PhysX Force and a Wind Space Warp to push the particles upward when the PhysX Switch Anti-Gravity is applied. The Anti-Gravity is animated letting the PhysX World Gravity take over for specified durations. As with most operators its placement belongs above the PhysX World operator.

Brief description of the flow:

This flow is built off of a PhysX Flow Preset.

The Birth Grid is set to default.

The PhysX Shape operator is set at default.

The PhysX Force operator is populated with a default Wind Space Warp. Type is set to Surface. Surface detects the surface area of the particle to calculate the influence. Since particle surface area is being used to determine the amount of force applied it is not necessary to use as high of an Influence setting as the Uniform and Gravity Types. It is set to 300.0 percent.

The PhysX Switch is only using Anti-Gravity and the switch is animated. This causes the PhysX World gravity to become "neutral" when the switch is active. Causing the particles to rise from the influence of the wind. When the switch is off the PhysX World gravity has influence over the particles again and they begin to drop.

The resulting animation:

 

 


Example 7 - Basic Setup - Birth Group, PhysX Shape, PhysX World, and PhysX Glue.

Scene File: Max9_Box2Basics_Sample7.max

Back to Top

The Birth Group was designed convert scene geometry into particle shapes. It handles Grouped object sets, Sub-object elements, as well as standard geometry.

This sample uses a pre fractured box object as in the Birth Group as a wall which is then knocked down with a Birth Stream event. The Data Operator "Mass By Volume" is a simple four sub-operator to gather particle mass for the PhysX Shape operator. Since this Data Operator alter PhysX properties it needs to reside above the PhysX World.

Brief description of the flow:

The Wall and Teapot Event:

The Birth Group contains a group of objects (the pre fractured box) and three teapot primitives. The pre fractured box since it is a group needs to have the "Group Members" checkbox selected in the Separate Particles For group.

In the PhysX Shape operator the friction was raised for a more gritty effect. The Mass is set to Data channel and it is being generated from the Data Operator "Mass by Volume". Since all of the particles are different sizes to generate mass by each particle objects volume makes the most sense.

Mass by Volume, as described above, generates a mass by the volume of the particle, you can increase this mass by raising the multiplier value.

The PhysX World operator changes were limited to the sub frame samples. It is currently set to 26. this number coincides with the general rule of:
2 times the number of per particle binds + 2

 

Cannon Balls Event:

The Birth Stream is generating a stream of particles.

The PhysX Shape it is necessary to bump up the mass of the the particles. Since cannonballs are typically made from dense metal such as lead, the value is set to 20000.0. This is more of a "what looks right value"

The PhysX World is simply a instance of the first events PhysX World

 

The resulting animation:

 


  Back to Top