Example - Using Primitive Shapes with Bullet
#Example - Using Primitive Shapes with Bullet
1.1Floor
1.2Cube
1.3Ball
Preparation
In order to create a working Bullet scene that can be rendered, we'll start with three nulls called Floor, Cube and Ball.
Let's take each individually:
Floor
Start by hitting Ctrl-N (or selecting Items > Add > Null) and typing Floor into the options panel that appears. Then hit P (or choose the Properties button at the bottom of the screen) to bring up Object Properties. Set the Primitive Type to Plane and the Radius to 5.0 as shown:
Cube
Repeat for the Cube.
There are no changes to the Radius.
Ball
One last time for the Ball null. Hit P to open the Properties panel, change the Primitive Type to Shape. The Sphere shape should be selected by default. Set the Radius to 0.25:
You should now have a wireframe plane, box and sphere in Layout. Save the scene.
Simulation
With our three objects created, we need to set them up for simulation. To start with, move the Cube object up by so that it sits on our floor and the Ball so that it's above both. VPR should show something like this:
If we hit Play now, the three objects will just sit serenely in space and we want something more dynamic. Go to the FX Tools tab and select Item Properties from the Bullet group. With your Floor object selected use the Bullet Properties window to Add from Layout Selected for the three objects as shown:
For the Floor object we selected Static, for the Ball object we chose Sphere as the Shape
Bullet puts an OpenGL overlay on our objects to show their bounds for simulation. While the Cube object is perfect, we changed the size of our Floor and Ball, so we need to change the size of our Bullet bounds too.
Select the Floor object first and change to its Transform tab:
Change Scale to X: 10.0, Y: 0.2, Z: 10.0 and set Position to Y: -0.1 so that the shape is under the floor
Then choose the Ball and change Scale to 0.5:
You now have dynamic objects in the scene, but still no geometry. Save your scene. You will see that it is larger than normal of a scene of this type, but self-contained.
If you press Play now you will see the cube drop to the floor and the ball roll around a little on the cube but it's hardly exciting. Now you have created your starter objects you can duplicate those you want to and the settings will be ready. These Primitive Shapes can all be surfaced.