ocamlgraph3d

A rasterization based 3D graphics renderer, implemented in OCaml.

Author: Jacob Welsh, 2014
This program is free software; you may modify or redistribute it under the terms of the MIT/X11 license (included in the source download).

Notes

This code is not intended for real-world graphics applications, which should generally use existing, hardware-accelerated APIs like OpenGL (OCaml binding: lablgl). It exists as an example of how graphics techniques might be implemented in OCaml, and a test bed for experimentation.

In addition, it features an experiment in the use of dynamic linking to improve developer productivity through greater immediacy. Rather than the typical cycle of write/save/build/run/test/repeat, a subset of the code (render.ml) is watched for changes through inotify. Whenever it's written, it's rebuilt and re-linked into the running program. So for example, if there's a drawing glitch that's only evident at a particular viewing angle, rather than struggling to find the right angle again after every change, the code can be tweaked on the fly without losing the rotation state of the UI.

See the README for more details.

Screenshot

screenshot

Download