Posts Tagged computergraphics

Everything Is A Sphere

When I was down with a cold last week I dug out a book about computer graphics that I bought during my university time (3D Computer Graphics by Alan Watt). It provides a mathematical foundation for many core techniques in CG, and it got me interested again. About 8 years ago when I bought this book I wrote a small raytracer in C++, and since I am really in search for new hobbyist projects to teach myself Scala, I figured I could give it another shot.

Scala is a statically typed functional/object oriented language for the JVM and the CLR, and at least on the JVM it is known for providing performance similar to Java (in contrast to dynamic JVM languages such as Groovy or JRuby). This is the first scene that provides something my 8-year-old project couldn’t, namely a checkered surface (composed of two other surface instances). The code is pretty newbie-like and a bit unstructured, so for now I’ll leave it at that. FWIW, it took about 5 seconds to render this picture on my rather mundane home machine (Athlon X2 @ 2.2GHZ, Windows XP) using the 1.6.0_11 server JVM.

A World of Spheres

Leave a Comment