Thursday, 17 May 2007

Rigid Body Simulator

Here is a real-time 2D rigid body simulator that renders some balls bouncing around a scene using OpenGL:

http://www.ffconsultancy.com/ocaml/balls/?ob

The whole program is under 400 lines of OCaml and performance is excellent: the program can simulate 100 balls in real-time with sub-centisecond accuracy on my machine.

No comments: