Caffeine Abuse - The Blog

How to fill a volume using rigid body dynamics in ICE

The standalone or default rigid body dynamics engine is the preferred solution if you’re simulating few or a fixed number of objects and need high precision. If you’re on the other hand are set to take on a large number or are adding new objects to the simulation over time then ICE would most likely be the one to choose. Even as booth engine uses the physX as the dynamics engine, ICE still isn’t the answer to all your upcoming simulation struggles. And the reason for this is quite simple. Kinematics isn’t officially supported within the ICE framework yet (though it can be activated manually) and the actual shape isn’t available as a collision type.

Open the scene fill_bag.scn from this issues DVD. Press [4] to switch to the simulation Toolbar and select the bean_emitter. From the Simulate > ICE > Create menu choose Emit Particles from Selection. With the PointCloud selected, press [Alt]+[9] to open the ICE Tree. Double click on the Emit from Surface node to open it’s PPG. Change the Size to 1 (which translates to 100 percent of the instanced geometry size). Since the actual shape isn’t supported you’ll have to make do with the next best thing, convex hull. The convex hull is an approximation of the objects actual shape and thus is much faster to calculate. The drawback is that it doesn’t take any holes or dents into account, which can become a bit of a problem since you’re trying to fill, that’s right, a hole! The solution to avoid this obvious bottleneck is to break the object into a number of flat objects and use these as the obstacles.

Get an Instance Shape node, open its PPG, click the Explorer button and choose the CoffeeBean object. Close the PPG and connect the node to the Shape input of the Emit from Surface Node. As you’re merely trying to get those rich and tasteful little beans into the paper bag, a simple gravity force will do the trick. Get an Add Forces node and connect it to the Port 2 input of the ICETree. Then get a Gravity Force node and connect it to the Force1 input of the Add Forces node. Since you’ll be using RBD to compute you don’t need the Simulate Particles node so simply delete it. Instead, get a Simulate Rigid Bodies node and connect it to the Port 3 input of the ICETree node. Open the Simulate Rigid Bodies PPG and change the Elasticity to 0 to keep the beans from bouncing straight out from the bag. Press [8] to open an Explorer and drag and drop the Bean_Obstacles group into the ICE Tree. Connect the obstacles node to the Obstacles > Geometry input of the Simulate Rigid Bodies node.

The project files used in this tutorial can be found at:


The rigid body dynamics in ICE does not only compute faster than the traditional RBD in Softimage, it also turns the handling of thousands of delicious coffee beans into a no-brainer. The obstacles will be used in the simulation even if they’re not visible so you can hide the obstacles group and the bag to get a clearer view of your beans.

Quick tip
While the actual shape isn’t available as an optimized one-click solution, the same end result can be achieved by extracting each individual polygon of your obstacle as a separate object. Make sure you add a bit of depth to objects as this will assist the accuracy of the simulation.

1 Comment

  1. November 7, 2010

    can’t to do start capture, to see in real time simulation. Use Xsi 2011.5
    Flipbook play emty frames..