by Andrew Kickertz
Introduction to using Blender / Bullet to detect and respond to collisions of rough elastic bodies, particularly bowling pins and balls.
For the past few months I have been developing a Matlab-based bowling-oriented physics engine for simulating the collisions of balls and pins, as well as the lane, gutters, and side walls. This ‘from-scratch’ approach has provided much insight into collision detection and collision response, and has had some fruits. Simulating 2-dimensional collisions (imagine an overhead view of a bowling lane) with or without friction accounts for many of the phenomena observed in bowling. In particular, how pinball varies with the final lateral position and final heading of the ball is captured fairly well by a 2D model.
Anyway, a couple weeks ago I discovered that Blender, the open source animation software, has Bullet, an open source physics engine, built in. Blender has a handy graphical user interface for assigning the following properties for each body (and perhaps more that I’m omitting):
- Coulomb coefficient of friction – this is not truly a property of a single body. In the collision of 2 bodies, I believe that the higher coefficient is used.
- Elasticity – aka coefficient of restitution. Again, this is not truly a property of a single body. In the collision of 2 bodies, I believe that the lower elasticity is used.
- Mass.
- Mass center location.
- Collision detection method – this can be bounding sphere, bounding box, convex hull, triangular mesh, or several others. ‘Sphere’ is the logical choice for the ball; ‘box’ is good for the lane and walls; ‘triangular mesh’ for the gutters; and ‘triangular mesh’ for the pins. A mesh is not as accurate or efficient as using sphere-swept surfaces, but take what you can get.
Rather than go into the details, I’m just going to post a pretty animation here: