Documentation of MRPT by J.L.Blanco & contributors is licensed under a Creative Commons License.
This example shows how to animate a set of 3D objects. It uses the simple equations of gravitation to perform the simulation.
Source code: http://browse-code.mrpt.org/stable/samples/gravity3d/