Tips to Get the Most Out of Working with Rigid Body Simulations
Just about every 3D application available has some type of rigid body capabilities, though the processes may differ slightly the outcome is the same. Whether you've used a rigid body simulation before or you want to learn the benefits of this powerful dynamic feature, there are some steps to take to speed up the process and get the most out of your rigid body simulations.
A rigid body is a type of dynamic simulation that makes an object into an unyielding shape. There are two kinds of rigid bodies: active and passive. The active rigid body reacts to dynamics, whether it's a field, collisions or some other type of dynamic. A passive rigid body can collide with active rigid bodies, but will not be moved and dynamics have no effect on them.
To better understand, think of a ball as an active rigid body and a floor as a passive rigid body. The floor will not move when impacted by the ball, but the ball will react to the floor, bouncing back into the air. A passive rigid body can also be hand animated, whereas an active rigid body cannot.
A rigid body simulation is great to use when you need objects to collide with each other rather than pass through when animated, which is what would normally happen. It also means you won't have to keyframe collisions, which saves a tremendous amount of time. Let's break down an example of animating a bowling ball crashing through the pins. Instead of hand animating each pin individually, and making sure there is no interpenetration with the floor or other pins, you can make the pins an active rigid body and the bowling ball passive. This way, you can quickly simulating the collision that would occur in real life, and save a tremendous amount of time on top of that.Preview the Simulation with Ghosting
When working with rigid bodies, you may notice that simulating the animation can take a very long time for the computer to calculate everything. Instead, you can use a feature known as Ghosting, sometimes referred to as onion-skinning. Ghosting will let you display a series of animated objects at frames behind or ahead of the current selected frame.
You can use this feature with your rigid body simulation to preview the animation without having to run the actual simulation. This is great for testing out different scenarios very quickly, and save time while doing it. Keep in mind that not all 3D applications have this ability, so check to see if the software you're running does.Save Calculation Time
Another great way to save calculation time of the rigid body simulation is to determine when your rigid bodies need to be active and when they don't. Even if your active rigid bodies aren't being impacted by anything, the computer still has to calculate the simulation, even if they are just sitting there.
For instance, if you want to have a large truck crashing through a brick wall and have each brick react to the impact, there is no reason to simulate the bricks sitting there as the truck drives toward the wall. Instead you could make all the bricks passive up until the frame before the truck hits, and switch them to an active object for the remaining frames.
Baking Rigid Body Simulation to Keyframes
If you are happy with the rigid body simulation created, but either want to make very slight adjustments or do not want to spend the time that it takes to calculate the simulation each time you play it back, you can covert the rigid body simulation to keyframes. This process is called "baking the simulation" and is a very powerful feature. After the simulation is baked to keyframes, you can make any sort of adjustments you need.
This way you can let the simulation do the bulk of the work and then go in and tweak it further to push the animation. The process is similar to motion capture, where an animator will clean up and polish the mocap animation.
To look at this process in more detail, let's assume you want to create an animation of ice cubes falling into a wine glass. Rather than animating the ice cubes manually by hand, you can make the ice cubes be active rigid body ice cubes and the wine glass be a passive rigid body. Then, by adding a field like gravity you can have the computer simulate what it would look like for the ice cubes to fall into the wine glass.
Once you're happy with the simulation, you can bake the simulation on the ice cubes. This will create a keyframe animation for each ice cube. The ice cubes will bounce around in the glass the same way, but now they are an actual keyframe animation instead of a simulation. This process can save a large amount of time during playback and will also allow you to fine-tune the animation to exactly how you want.
One thing to keep in mind when baking out keyframes is there will be a keyframe set on every single frame. This can be a bit messy, but you can quickly simplify it by going into the curve editor of your 3D application and deleting the keyframes that aren't necessary. Since keyframes don't require the same amount of calculation that simulations do, the end result will be the same realistic collision effects rigid bodies offer without the added simulation time.
Constrain Rigid Bodies
There may be a time when working with rigid bodies that you need to limit your objects to a specific movement. To do this, you can create constraints between two rigid bodies. For instance, you may want a door to be opened when something hits it. Without a constraint, the door would be hit and fly off into 3D space, which isn't very realistic.
To have it open properly and stay in place, you can create a hinge constraint to the door so when the object collides with it, the door will open but will rotate around that hinge constraint. There are numerous different rigid body constraints that can be utilized. Find out what type of rigid body constraints your 3D application has and play around with them to see which ones best meet your needs.
Adjust the Rigid Body Attributes
By default, the simulation you'll get probably won't be what you were looking for. The active rigid bodies may feel too light, too bouncy, or spin uncontrollably, or they will fly off into 3D space when hit by a passive rigid body. Take a simple sphere and cylinder for example. If you animated the sphere as a passive rigid body, and collided it with the cylinder as an active rigid body, the resulting simulation would look more like it was occurring in space rather than the normal gravity you would see on Earth.
In order to have the Cylinder bounce on the ground you would first need to create a floor for it to bounce off of, and then apply a gravity field to the cylinder. Now when hit by the sphere, the cylinder would fall back to the ground. Once you have the gravity set how you want it, you can the fine tune the other attributes like bounciness, friction, mass, etc., to get the results you want.
To give a better representation of this in action you can see from the video above that the cylinder on the left does not have a gravity field applied to it. So when the cylinder is hit, it spins off into 3D space. The one on the right, however, is affected by gravity and when hit falls to the ground it comes to a stop in a realistic way.
Rigid bodies are a very powerful feature that can be used to simulate complex collisions and other dynamics that would otherwise be extremely time-consuming with a traditional keyframed approach. While rigid bodies may not be needed for everything, they can definitely speed up your workflow. With these tips you'll be able to work with them much easier.
To learn more about rigid bodies check out these in-depth tutorials on Soft and Rigid Bodies in Softimage, Fundamentals of Rigid Body Types in Houdini, and Rigid Body Tips & Tricks in Maya. Find more training options with our 3D dynamics tutorials.