Recently, I've started working on a 3D game.  Something I've dreamed about for a while, and then saw a glimmer of in Artemis. I'll write more about that if I manage to get anywhere with it.

In support of making the game, I've been using the waveform file format (.obj) for things I'm working on in Blender. I'm not entirely happy with the obj loader, which is currently living on github, but still subject to tremendous revision.  To work with that, I've just begun working on cl-tga, which loads tga images.  It seems that obj files use mtl files to describe surfaces, and they in turn use tga files to hold the textures.  I haven't written anything to read a binary file format before, so it's been interesting.

It only took me a day to get things almost right, but they way in which it's currently wrong is amusing.

cl-tga screenshotYou'll notice that it's the same image repeated three times, but in each one the marbles are different shades.  For some reason, it's drawing the red, green, and blue as separate images.  Here's the file it's loading from:

marbles2

 

As much as it's frustrating to write all of this infrastructure, I'm hoping it'll make the barrier lower for other people who want to use lisp for games like this.