Thursday, 24 September 2009

Stanford Bunny

The OCaml Journal just published an article about mesh visualization:

"The Stanford bunny is a 3D mesh of triangles commonly used as a benchmark for computer graphics applications. This article presents an 85-line OCaml program that uses OpenGL to render the Stanford bunny in real time: the mesh is represented as a vertex array and an index array. The vertex array is a sequence of 3D vertex coordinates. The index array is a sequence of triples of indices into the vertex array referring to the three vertices of each triangle. Normals are generated independently for each vertex as the sum of the normals of every triangular face sharing each vertex, in order to provide smooth shading..."

To read this article and more, subscribe to The OCaml Journal today!

No comments: