Since last post I’ve been working on the MD2 and the X3D file formats. The MD2 format is a really neat, compact format designed for speed and ease of use, which made the implementation really easy. It was, however, not that trivial to extract the contents of the file. Seeing as I prefer not to a quick and dirty hack all the time, I wanted to make a binary reader which could read from little and big endian based formats and translate the contents into the format that the system uses. A lot of mistakes were made during the implementation of this reader, which resulted in it taking quite a long time to make it work. I will write a post about this later on, and also share my implementation which will hopefully be of some help to others.
The last few days has been dedicated on working on a X3D parser, which I hoped would be going a lot smoother, seeing as I already had experience in parsing XML documents. However, I just can’t seem to wrap my head around the specification documents. They are very hard to read and there isn’t really a good way to get a clear overview of the format. I did however find a project which takes the XML specification sheets and turn it into a validator/parser, which more or less takes care of the parsing issue. I don’t really like this approach, as it gives my project dependencies which I am trying to avoid as much as possible.
By the looks of it, I will only write about the format and not implement anything, as I am quite feed up at the moment with the specifications available. I will give it another go in a few weeks when I’ll start on the thesis, but the work that has been done will have to do for now.
I will therefor start on the B3D parser this week, in hopes that it will be somewhat easier to implement.
Since the last post, I’ve also made a simple texture loader, which in its essence is a singleton wrapper around the SOIL project, allowing a texture to only be loaded once. It’s really simple to use, as one only has to write
TextureManager::instance()->load(path/to/texture) to get the corresponding GLuint. Even though this gives the project a dependency to SOIL, I feel that it is worth it, seeing as it gives the project the ability to handle many different image file formats.
P.S. With the MD2 parser being done, I got to load the file for the BFG and do the attack animation…IT…WAS…EPIC!