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).
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:
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:
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:
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:
Now click the Start button and see the difference:
So once again: you need to select everything you want to move.
Simulation Parameters
There are two configurable options in the Physics tool:
- Friction — the level of friction between the objects;
- Bounce — how “springy” is the surface.
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:
- Start - starts or resumes the simulation;
- Pause - pauses the simulation if it is running;
- Reset - reset the scene to its initial state.
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:
Click the Start button and see what happens:
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:
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:
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:
- Number of copies — defines how many instances of the initially selected objects to create while running the simulation;
- Scatter copies — tells Boxshot to randomly rotate the new instances after creation, so they fall in a more random way.
Here’s the same scene with just one sphere above the bowl and the number of copies set to 10:
Now run the simulation, wait a bit and click the Pause button. You’ll get this:
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:
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:
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:
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
- Realistic Rendering — improving scenes visual appearance;
- Lighting — control environment and directional lighting;
- Saturated Reflection — make "rich" colorful reflections;
- Floor Reflection — reflecting scene objects in the floor;
- Job Manager — rendering jobs later;
- GPU Rendering — rendering scenes faster on GPU;
- Rendering Time and Quality — getting more control on rendering;
- Simple and Realistic Lighting — speeding up scene rendering.
Materials
- Texture Slots — how to use texture slots in Boxshot;
- Glass Materials — how to make semi–transparent objects look attractive;
- UV–Spot — how to make a UV–spot effect easily;
- Foil Effect — how to add foil–finishing to your shapes;
- Bump — adding relief to your materials;
- Copying Materials — how to copy materials to other shapes;
- Custom Materials — extend the materials library with your own ones;
- Semi–Transparent Labels — making semi–transparent and partial labels;
- Boxshot Materials — more details about Boxshot materials.
Features
- Decals — applying decals and configuring them;
- Bump Decals — applying bump where it is needed;
- Depth Of Field — adding more realism to your renderings;
- Tools — read more about Boxshot tools;
- Managing Images — how to manage image files used by Boxshot projects;
- Shapes Instances — creating lightweight copies of other shapes;
- Model Editor — edit embedded models in many ways;
- Shrink Wrap — heat–shrink film simulation for objects wrapping;
- Physics Simulation — applying gravity to your scene;
- Palletize — arrange scene objects for the pallet;
- Snapshots — save scene state to re–use it later;
- Translation — teach Boxshot to speak your language;
- Vector Artwork — how to maintain the quality of vector artwork.
Shapes
- Lathe Objects — making symmetrical objects using revolving curves;
- Loft Objects — making custom objects with 2D cross–sections;
- 3D Text — making 3D text objects in Boxshot;
- Extruded Objects — how to make thick 3D object of your flat 2D curve;
- Conical Labels — making conical labels with distorted artwork;
- Dieline Box — a very realistic dieline–based box;
- Custom Shapes — adding custom shapes to the left panel;
- Third Party Shapes — importing third party shapes to Boxshot.