Adding support for OpenCTM files

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
marcus256
Posts: 2
Joined: Tue Dec 15, 2009 3:23 pm
Location: Sweden

Adding support for OpenCTM files

Post by marcus256 »

Hi!

I did a quick hack (~200 lines of code) to load OpenCTM mesh files with Irrlicht (see openctm.sf.net for more info). The mesh viewer example (09) works just fine - great! I think it would be a nice addition to Irrlicht, especially since OpenCTM provides very fast loading of very compact (compressed) files.

However, since the loader requires an external library (e.g. libopenctm.so under Linux) to actually decode the files, there are (as I see it) two options:

1) Require the installation of OpenCTM on the build computer, and modify the build rules (Makefiles etc) to include -lopenctm, for instance. Not very nice (but this is how I tested it - and it works).

2) Make the OpenCTM library an integral part of Irrlicht - just as with zlib, libpng, etc. This would be much cleaner - and stick to the "minimal external dependencies policy" that seems to work well for the Irrlicht engine.

Any thoughts? (I am quite new to the Irrlicht source code tree)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Eh, nice try. But I already made such a loader a few weeks ago. It's part of the irrExt project. Due to the extra libs it's not likely that it will be integrated into the core library. But the irrExt project is a good place for these add-ons. If you find any problems or additions with the existing loader just tell us. However, I didn't get a proper compressed file export at that time, it seemed that the mesh converter of OpenCTM has had a bug then. So I don't know if it was correctly working.
marcus256
Posts: 2
Joined: Tue Dec 15, 2009 3:23 pm
Location: Sweden

Post by marcus256 »

Sorry - I didn't even know about the IrrExt project - now that I know about it, I checked the code...

I have a few enhancements (vertex colors, for instance). I also see your point with the external library issues.

One possible solution, as LZMA already seems to be part of the Irrlicht core, would be to write a minimal OpenCTM loader specifically for Irrlicht (a trimmed down version of the standard OpenCTM library) - it would probably be quite lightweight.
Post Reply