COLLADA Nightmare

I recently started a project for virtual walks, and one of the first design challenges I had was how to store the map information. COLLADA, a standard for media assets sharing I found while dealing with the Bullet Physics Engine previously in another project, seemed like the obvious alternative to me, although I knew nothing about how to work with it. I started by searching for a COLLADA related package on my distro and found none... that's generally a bad start. Next, I searched on Wikipedia and found COLLADA DOM and FCOLLADA. Since FCOLLADA seemed a lot more promising, I started by trying it out, but it turns out that the company stopped the Open Source production of FCOLLADA in 2008. So next on the list was COLLADA DOM, which I downloaded and tried to compile.

There were lots of errors during the compilation process and, for my surprise, they weren't cryptic at all: some of them were errors I was used to see when I started programming in C++, like "string is undefined". Without really thinking it would help, I jumped into the files and started editing those to get rid of the simple errors. The most complicated ones were due to some other things like missing libraries and wrong include paths. In general, to compile all of the subproject under COLLADA DOM, it requires nearly half a dozen libraries (Boost Filesystem, Libxml2, MiniZip, Cg Toolkit, GL, GLU, glut, and for my surprise, Bullet Physics Engine). After sorting out all of the problems I found trying to compile things up, it was time to run the always friendly make install at each subproject which should have put everything in place at /usr/local/include and /usr/local/lib. It threw me a couple of weird errors because all of the subprojects were trying to install the libcollada*dom files, which were files from just the first project, but I didn't pay much attention to that and copied files from the dom subproject to each of the other subproject. I then tried out a program using the library, and it couldn't find a good amount of the libraries I had just compiled. I wondered why, and checked the installed library files... and no subproject but the dom subproject were installed. I returned and checked the Makefiles in each subproject and, guess what?, they were all the same... someone just copied the dom subproject's Makefile throughout the other subprojects and shipped happily. I then understood why was that that all of the subprojects were complaining about not finding the libcollada*dom files, and fixed the naming in the Makefiles. After that, the installation of the libraries went Ok. Yet I still wasn't able to compile my program. After taking a close look at the error messages, and checking Bullet sources, I noticed the problem was the version of the Bullet libraries used to code COLLADA versus the version of the Bullet libraries I had, which were newer.

So far, I'm still trying to get that sorted out. There are various possibilities from this point on: Bullet itself provides, among its various samples, a sample using COLLADA DOM which seems to be a patched version of the project as you download it from the web... but I get weird errors on the include paths when trying to compile that :s. Another strategy could be hand-patching the sources which at the same time would help me gain some experience on the Bullet Physics Engine, but that looks just too time consuming so I probably won't do that.

I hate to talk bad about an Open Source project, but frankly these guys need a lot more documentation, and to be more specific, a lot more of multiplatform documentation as I really think, judging by the number of references I see to Windows and Visual C++ among the sources, that my problems would already be solved if I was using Windows. Yet, the Linux community cannot ask too much from a project that is not being widely used in Linux, so why don't we start testing out these kind of libraries and including them on some distros to eventually have better support for our community? That would at least create a lot more forum posts from Linux users that could help others trying to use the library themselves.

I just hope I can soon post again about how I got this thing working, with a screenshot of a rendered document and all :) Yet, as my good friend Kahty said, "this is more like a COLLADA DOOM" hahaha.