Posts Tagged Programming

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

Hello XO!

For learning a new language or framework, I tend to use tasks I’ve solved before – this way I’m more focused on the new platform instead of the problem itself. One such task is a sudoku solver, another tic-tac-toe. One rainy afternoon, trying to escape boreout at work, I mindlessly typed apt-get install tictactoe on my Ubuntu workstation, and I discovered that my Ruby tic-tac-toe client from 2002 is still in the Debian/Ubuntu repositories (and it actually works!).

I wanted to play around with Swing/Netbeans, so after a couple of evenings here’s the Java/Swing version (but this time, I hopefully did not mess up the negamax implementation): JTicTacToe (Webstart)Sources

It was actually quite fun, except that I gave up forcing an initial size for the main application window. Seems like there’s no easy way of achieving this with the Swing Application Framework.

Leave a Comment