![]() |
![]() |
OCaml tutorials and examples |
2D Rigid Body dynamicsThis program draws balls bouncing around a scene by representing the balls as rigid circles and simulating their dynamics: The program has the following properties:
The OCaml programming language allows this task to be completed with the performance of C++ and the brevity of functional programming. Moreover, future languages like F# will allow such computations to be performed concurrently, using multiple cores or CPUs, to further improve both performance and GUI responsiveness. DownloadsThe source code can be compiled with: ocamlopt -I +lablGL lablgl.cmxa lablglut.cmxa unix.cmxa balls.ml -o balls The program can be run by specifying the number of balls n: ./balls n
|
© Flying Frog Consultancy Ltd., 2007 | Contact the webmaster |