Koppi’s Bullet Physics Playground

Koppi’s BPP + Wings3D + POV-Ray 3.7 RC6, Oct-2012

After the sslt tests with the dominoes pieces, I was thinking that it would be nice to do a sort of “domino effect” scene, but setting it up by hand looked like crazy… so I started looking into automatic alternatives.

The first one was to use MegaPOV mechanics, but somehow I got a little bit scared by the docs… so I continued searching and found something called Bullet Physics Playground by Koppi. It is a little, mostly alpha tool to play with LUA scripting and the Bullet Physics Library, with the nice extra feature of exporting to POV-Ray.

Below are some of my first tests with it, using assistance from the author to make it compile and run on my system. The program it’s not documented at all, and has little examples, but the potential is there… and it’s big. And it already helps making a lot of scenes that previously were very difficult…

In fact, I liked so much the program that I’m going to try to make it better suited for POV-Ray users, hopefully with the help of the author, either on the main branch or making a fork. I already corrected a segfault and a few little bugs, just because I was forced to: Koppi is sailing until mid-december, and I really wanted to use it with something more complex than the examples.

Another nice thing about Koppi’s playground, is that it allows to construct scenes the way you will do on POV-Ray, with loops, and if’s, and lots of random values here and there… The tool consists on a LUA interpreter, which is the “interface” to the Bullet Physics Library. There are some bindings in place which allow to create simple collision objects, and to add them to the physics simulation. Then you run the simulation, and the whole thing is rendered in openGL on real time.

You can export each frame to POV-Ray format too, and that’s the actual good thing about it. It’s currently very simple, and only exports basic primitives with fixed SDL code, but after the export I do some automated search&replace to put there my own objects, with the same or similar shape and dimensions, leaving the transformation matrix in place, and …voilá!