Physics Simulation

Sometimes you need to fill something with something else, or just drop a number of items to the floor so they look scattered. Boxshot offers the Physics tool for that.

The Physics tool applies gravity to the selected scene objects and keeps the rest of the scene static. The selected objects fall down, colliding with the rest of the scene in a realistic way. Boxshot keeps the simulation running until the items stop. You can control the process with numerous parameters.

Here’s an example of what you can do with the tool (thanks Wojciech).

The results of physics simulation in Boxshot

Let’s Start

Create a very simple scene of two spheres. One is bigger and stays on the floor, while another is smaller and hangs on top of the first one. Something like this:

Two spheres one on top of another

Once ready, make sure that only the top sphere is selected, then right–click it and select Tools → Physics in the popup menu. The Physics tool window will pop up:

Physics tool window in Boxshot

Without changing anything click the Start button at the bottom. Boxshot will run the simulation and you will see the green ball falling down, colliding with the blue one, falling to the floor and rolling out.

You will end up with something like this:

The aftermath of the physics simulation

That’s pretty much it. You select the shapes you want to move, run the simulation tool and click Start. Easy.

What About the Rest of the Scene?

You might noticed that the blue ball didn’t move at all. The reason is that Boxshot only runs the simulation for the selected objects. The rest of the scene is kept static, so it won’t move even if another object collides into it.

Let’s try changing that. Set the green sphere’s radius to match the blue one, select both of them and run the Physics tool again:

Both spheres are selected in Boxshot

Now click the Start button and see the difference:

Both spheres have moved after the simulation

So once again: you need to select everything you want to move.

Simulation Parameters

There are two configurable options in the Physics tool:

Both parameters are applied to everything in the scene and let you fine–tune the simulation.

Increasing friction slows down the sliding and rolling and keeps objects less scattered during the simulation.

Increasing the Bounce parameter makes the falling objects jump back.

Try changing the parameters and restarting the simulation with two spheres to see their effect.

Controlling the Simulation

There are three buttons at the bottom of the Physics tool window:

You usually need just the Start button. Boxshot runs the simulation while objects are moving and then automatically stops it. If you are happy with the result, you simply click OK.

If you are not happy with what you get, you might want to adjust the simulation parameters. Then you need to click the Reset button, so Boxshot rolls back all the changes, then you can adjust the parameters and start the simulation again.

Simulating Multiple Shapes

Let’s change our scene a bit. Use the Lathe or Loft tools to make a bowl, then place a small sphere above the bowl and use the Step and Repeat tool to clone it. You’ll get something like this:

Group of spheres above the bowl ready for simulation

Click the Start button and see what happens:

The unexpected result of simulation

Well, that’s hardly what you expected, right?

The reason is that the whole group of spheres was initially selected. Scroll up and check the scene tree on the left. The only selected element in the scene is the group named “Sphere_4 S’n’R”.

So here’s the important note: Boxshot produces groups and other nested elements as a whole. The nested items don’t move against each other, they act as one thing.

That’s what happened to our spheres. Roll back the changes with undo and select all the spheres instead of their parent group:

Selecting spheres instead of their parent group

Note that every sphere has a selection frame around it. This is a good sign that every sphere will go its own way in simulation.

Click the Start button and see the result:

Every sphere is now simulated separately

This time it went as expected. All the spheres fell down into the bowl independently.

Making Copies

It might be tedious to clone the shapes this way to fill something up. On top of that you might not precisely know how many shapes you will need at the end.

Boxshot makes it easier using the Copies section of the Physics tool.

The section has two parameters:

Here’s the same scene with just one sphere above the bowl and the number of copies set to 10:

Setting the number of copies to 10

Now run the simulation, wait a bit and click the Pause button. You’ll get this:

Paused simulation of 10 falling balls

The simulation is not yet finished, as we paused it in the middle, but you can see the main principle: instead of one sphere, you’re getting a number of them.

Basically, Boxshot waits till the sphere falls down a bit and create another one in its initial position. It does that until it makes 10 spheres, as you configured by the Number of Copies parameter.

There is another reason why we paused the simulation. Note that you can change all the parameters while the simulation is paused. This includes the number of copies itself!

This means that you can increase the value if you feel that 10 is not enough, or decrease it if the number of copies you have feels sufficient. Then you can click the Start button again to resume the simulation.

Advanced Topics

Here we cover more advanced topics, so feel free to skip if this feels “too much” at some point.

What About Mass?

Mass is the fundamental parameter in simulation. The heavier object affects lighter objects more and is less affected back by them.

If you make that green sphere smaller and restart the simulation, you’ll notice that the blue sphere moves less or even stays still.

So how does Boxshot get the mass? The mass is the function of volume and density. Boxshot assumes that all the objects have the same density and relies on the rough volume estimation to get the mass. This usually works fine and the bigger objects act as they are heavier.

If you want something to act more on other objects — make it bigger. If you want something to be less affected by impact — make it bigger too, or do not select it to make it static. Static objects have infinite mass and are not affected by collisions.

What About the Center of Masses?

Boxshot uses the pivot point of the shape as its center of masses. This works fine more most of the shapes, but some (like the Soda Can shape) has their pivot point at the bottom.

Give it a try yourself: make a new scene, add a soda can shape, rise it up and let it fall using the Physics tool. To make it more funny, set the number of copies to 10. You’ll most likely get this:

Simulating 10 falling soda cans

During the simulation you’ll notice that the can fall aside and then stand ups. The reason is that the pivot point, their center of masses is at the bottom. Imagine that every can has a very heavy weight at its bottom, to make the behavior more clear.

So how to fix that? Boxshot doesn’t let you change the pivot point of shapes, but you can use groups to deal with this. The solution is to select the can shape and press G to group the can with itself:

Adjusting the center of masses of objects

Notice the right can is the child of the “Group” node and that group’s pivot point is now in the center of the can, which is exactly what you need.

If you need to move the pivot point away from the center, you can also group the shape up and then move the shape inside the group. The group pivot point will stay intact, but as the child shape moves, the final pivot point will be moved to the place of the shape you need.

Now run the simulation again for that “grouped” soda can and see the difference:

Simulating soda cans with centered pivot points

Much better :)

Simulation Speed

The simulation might get slow if you run too many objects at once. Say you want to feel a bucket with 1 cent coins — you’ll need a lot of them and it will definitely gets slow at some point. So what to do?

The rule of thumb is to minimize the number of simulated objects. The less — the better. You can put something bit to that bucket, so the coins need to feel up just a narrow space left. This will require less coins and will speed the process up. No one sees anyways :)

Another trick is to make simulation in layers: drop a number of items, let them settle, then exit the simulation and start it again fresh. The previously processed elements become the part of the “static” scene and don’t affect the simulation speed that bad. This way you can highly improve the processing speed if you need to process a lot of objects.

One More Thing

Boxshot does not simulate the real shape of the processed objects. Instead, it simulates a convex shape that looks very similar the original object. Imagine you tightly wrapped your object into a film, so no holes left — everything is perfectly convex. That’s what Boxshot does. This means you cannot put a torus on a pole, as Boxshot sees that torus as a disk (remember: no holes).

This doesn’t really matter in most cases, but it is good to know.

Thin Walls

The simulator doesn’t like thin walls. By thin I mean “zero thickness” walls. Try adding some thickness to avoid issues.

Finally

Do not expect too much from the simulation and get ready to adjust it here or there or do some post–simulation fixing. That’s expected :)

More Tutorials

Rendering

Materials

Features

Shapes