Table of Contents
Dynamics Simulation Concepts
In addition to standard particle collisions, thinkingParticles now sports a new rigid-body dynamics system to help you create even more impressive effects. In order to get the most out of both of these dynamics systems, it is absolutely essential that you understand the basic concepts behind each of them.
thinkingParticles offers two methods to handle collisions between objects.
- An idealized particle-based collision detection
- A more accurate face-to-face collision detection
Both systems are based on real world physics and use an underlying impulse-based system to handle energy conservation issues when objects interact with one another. At the base level, thinkingParticles's dynamics system follows the real world paradigm that energy can not be destroyed. As in the real world, the relative speed and mass differences between objects are very important for determining the final outcome of the animation. Therefore, for realistic simulations, you will need to input realistic parameters, otherwise the whole system can break down or explode.
It is important to consider proper dimensions and modeling when physical accuracy in the simulation is needed.
Particle Based Collision Detection
thinkingParticles's most optimized and efficient physics simulation method is its Particle-Based system. All impulse calculations and energy transfer calculations are done within incredible accuracy when you choose this method. The only restriction lies in the assumption that every particle is spherical in shape and has a uniform radius. This method is usually not an issue for traditional particle animations such as rain hitting a window, or sparks flying off a grinder, etc. In these cases, the particles are small enough that the collision detection won't create any sort of problem.
The idea behind this dynamics model is purely based on speed - using a spherical shape for collision detection is optimized and lets the physics engine to test for a radius only. This kind of collision detection is efficient even with thousands and thousands of particles. So whenever possible, this pure particle dynamic model should be used. The Dynamics Operator StdCollision is used to help with these kinds of effects.
Face to Face Collision Detection
When creating complex particle animations for your scenes, it is not always possible to get away with spherical collision detection. There are many situations when accurate face to face collision detection is necessary. For example, if you were to drop a vase from a height, and have it crack into multiple pieces, if you base the particle collisions off of the radius of the particle, portions of the fragmented geometry will pass through the floor and will destroy the illusion that you are trying to achieve.
As a result, the face collision detection engine within thinkingParticles uses a far more advanced physics engine to detect exact collision points on surfaces. It was designed specifically to handle cases like the vase example above, and was used extensively by Digital Dimension on the New Line Cinema motion picture Blade: Trinity while being developed to handle the vampire “ashing” sequences where the bones would crumble and collapse to the floor.
thinkingParticles provides you with a special operator to access this engine; the ShapeCollision Operator is used to create dynamic simulations with particles between other particles and an optional floor object. The particles and floor objects can be in any shape or form and the collision detection will accurately detect the shape of the particle fragments and provide an accurate result.
A final note - all collision detection performed within thinkingParticles is done only between non-penetrating rigid bodies. If you have two objects that overlap or interpenetrate at the beginning of your simulation, they will not behave correctly.
Dynamics Sampling
As has been stated earlier, thinkingParticles uses an impulse-based approach when it calculates object collisions and interaction. The main driving force for this approach (and other physical simulation systems like reactor) is the sampling that is used to determine collisions. Most systems, including thinkingParticles, allow you to control this sampling rate at the Frame and Sub-Frame range. What this means is that within a fixed time frame (the sampling range - once each frame or several times per frame), the collision detection system will try to detect any object collisions. The larger the time step, the less accurate the simulation will be.
If you'd like more information on how rigid body dynamics function, you might do well to read through the reactor introduction in the 3ds Max Reference Manual. This should give a good overview and basic understanding of the terms and features a dynamic system can have. These same ideas and principles apply to thinkingParticles.
In the example below, we'll use a simple scene of a box object (Object1) falling toward a ground plane (Floor) to illustrate some of the problems you can encounter when simulating real-world scenes.
In the above example, the box is falling at such a rate of speed that from frame 1 to frame 2, it has passed through the ground plane. If a Per Frame simulation sampling is used for collision detection, the Floor object will be missed completely by the physics engine as it had no chance to detect the collision. However, if a Per Half Frame sampling is chosen, the physics engine would be able to detect an object collision as shown below.
As you can see, at frame 1.5 an object collision occurs and can be detected. Once detected, the physics engine can then correct the behavior of Object1 to represent a real world result. It is important to understand that the sampling rate is one of the main controls that will influence the result and quality within the thinkingParticles dynamics engine.
Controlling Sampling
Frame Sampling controls for all of your particle based effects in thinkingParticles is done through the Master DynamicSet global controls. There, you will find the Viewport Sub-Sampling parameters. Sub-Frame Sampling can be set independently for the interactive Viewport display and the final render.
For complex face-to-face collision detection, you should set a Sub-Frame sampling rate of 80-120 samples per second to ensure an acceptable result for your collision detection.
This also brings up a good point - the velocity of the objects that are to be tested for collisions will factor into the equation. Slower moving particles may not need a massive amount of Sub-Frame sampling, while faster moving particles may require more to achieve acceptable results. Of course, the higher the Sub-Frame Sampling rate, the longer it will take your computer to calculate the collisions and final result. Therefore, you may want to adjust the sampling until you get the dynamics animation you want.
Where to go Next?
Understanding Dynamics and how you can control them is another cornerstone in getting amazing results from thinkingParticles. Continuing with the theme of introducing you to the newest concepts within thinkingParticles, we'll explain how the Initiator class of Operators will improve your animations AND save you time and effort.
While it is highly recommended that you go through the Introduction material in order, if you prefer you can click on any of the topics that interest you.
©2024, cebas Visual Technology Inc.