- [Instructor] MassFX is the physics engine
for rigid and soft body dynamics in Max.
It's an implementation of the NVIDIA PhysX engine.
But it does not require NVIDIA hardware.
That is optional.
You can use an NVIDIA video card
in order to accelerate the calculations for PhysX,
but it will run on any CPU.
Over the next few weeks,
we'll set up a basic rigid body simulation
of this game of Eight-ball.
Before we begin,
it's very important to know that
because this is a physical simulation,
we can only expect accurate,
or good results if the scene is modeled to real world scale.
This is a regulation sized pool table,
although it's missing its pockets.
All the objects in this scene
are modeled at real world size,
and all of their scale transforms
are at 100% in all three axes.
MassFX operates in system units
which by default in Max is an inch.
MassFX has some minor bugs
in the display of units
in the interface.
So, to avoid confusion,
the display units should match the system units.
For consistency,
I've set the system units,
and the display units both two inches for this scene.
If you're working in the metric system,
then I recommend setting both the system,
and the display units to your desired units
before building your scene.
The MassFX tools can be accessed from the animation menu,
in a sub menu labeled MassFX.
But the MassFX toolbar is quicker and easier,
and it gives instant access
to the simulation playback controls.
So, let's open up that toolbar.
Just right click on the textured area
of any toolbar including the command panel.
And from that pop up menu,
make the MassFX toolbar visible.
I'm going to drag it down here to the lower right
near the animation playback controls
because we have a different set of playback controls
for MassFX itself,
and I don't want to get confused.
I always want to be pressing the correct button here.
On the left of that toolbar
is a button to launch the MassFX tools window.
Click on that,
and we get MassFX tools with four different tabs here,
World Parameters,
Simulation Tools,
Multi Object Editor,
and Display Options.
The default tab is the World Parameters,
which is the solver settings
for all of the MassFX objects in the scene.
At least in 3ds Max 2021,
the values that you see here may be different
depending upon whether you've ever issued
the reset command in the current session.
I've currently got substeps,
and solver settings set to pretty low values.
We'll be investigating those values later.
In the simulation tools tab,
we have the ability to start and rewind the simulation.
We also have that on the toolbar.
Something we don't have on the toolbar
is the ability to bake this simulation,
and convert it to key frames.
We'll be taking a look at that
at the end of this little mini series.
Right now,
I just want to open up the simulation settings,
and within here,
change the playback on last frame option
to stop simulation.
By default,
the simulation will keep running endlessly
even if we've reached the end
of our current time period here.
So, let's set it to Stop Simulation.
So the simulation will actually end
at the end of the current time segment.
Down a little bit further here,
We've got a utilities section,
and there's a valuable button here,
Validates Scene.
Click on that,
and we get a child window,
Validate PhysX Scene.
This is going to check to make sure
that all of our objects are legal here.
Click the validate button,
and you should see green bars over here for everything.
Okay.
Our scene was validated correctly,
so we can close that dialog.
Now we're ready to make our objects dynamic.
We can do that in multiple ways.
It can be done from this window,
or from the modify panel,
but the easiest way is from the toolbar here.
The second button from the left allows us
to assign the selected objects to be dynamic.
Click and hold on that button,
and you'll get a fly out.
We see that there are three options here.
Set Selected as Dynamic,
Kinematic,
or Static.
So, let's define these.
A dynamic rigid body is fully simulated.
The transforms of position in rotation
are controlled by MassFX forces,
and collisions
throughout the entire animation.
A static rigid body is a non moving collision object.
Static objects can affect dynamic objects,
but dynamic objects don't effect static objects.
A static rigid body cannot be animated.
Any animation will not affect the simulation.
But a kinematic rigid body
is kind of a blending of those two.
It's a collision object
that is animated by traditional methods.
A kinematic object can effect dynamic objects,
but usually dynamic objects
can't effect kinematic objects.
There is an exception.
We can set up a kinematic object
to transition to being fully dynamic on a certain frame.
We can set an object in motion using key frames,
and then let the simulation take over at a certain time.
The rigid body type can be changed
at any time in the modified panel.
So, I'm going to just select everything,
and make them all dynamic,
and then I'll make the pool table static.
Just drag a selection rectangle around everything,
and on the MassFX toolbar,
you want to click that second button from the left,
hold it down,
and choose Set Selected as Dynamic Rigid Body.
Once that's done,
we see some additional wire frames on the objects.
Those are the physical measures
that are being used
for the calculation of the MassFX Rigid Body Simulation.
By default,
MassFX does not use the actual polygon measures,
but a simplified version of those measures.
These are all dynamic objects.
So, let's make the pool table static.
Select the pool table,
go to the modify panel.
And now we have a MassFX rigid body modifier
on that editable poly object,
and the rigid body properties
change the rigid body type over to static.
Now let's play the simulation and see what we get.
We can deselect everything,
and then click the play button on the MassFX toolbar,
and that'll take a moment to start,
but once it does,
we see something pretty strange.
Those balls are all bouncing around just randomly.
We can rewind to reset the simulation,
and play that back again,
and again we see we're getting the same result.
There's quite a lot of jitter there.
The simulation is running,
but obviously there are some very serious issues here.
I'm sorry to have to leave you hanging with this,
but we're going to have to end the exercise for this week.
Next week we will fix this
by addressing the solver parameters,
and the so-called
physical shapes of the dynamic objects.