2
\$\begingroup\$

I am currently making a game in java using LWJGL 2.9 and I am wondering what the difference between the .obj format and .dae format is. Currently I can load .obj files and would like to load .dae files as well.

Any information on .dae files would be great.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ The difference is that they're different formats. Asking for all the details here or essentially "How do I write an importer for .dae files?" is too broad. Please clarify your question. What, exactly, about .dae files do you need to know? Have you looked at the official documentation? collada.org \$\endgroup\$
    – House
    Commented Mar 20, 2015 at 20:21

1 Answer 1

4
\$\begingroup\$

Your basic OBJ, or Object Wavefront file only contains geometry data - vertices, normals, texture co-ords, and optionally material data in an second file. It does not contain any sort of skeletal structure or motion data. Collada on the other hand contain both geometry data and optionally skeletal structure and motion data, along with scene information (eg light sources, camera), and a texture and material atlas.
Both file formats are regarded as interchange formats for transfering model data between modelling programs and to/from game SDK's.

Format wise, both are a plain text file format, with the OBJ file having one entry per line, making it easy to be read a parsed. If you know what section you are reading, you can process the line appropriately. Collada has a much more complex XML based structure that is much more difficult to parse.
However, due to their plain text format, and the fact they need to be processed, loading them is generally rather slow when compared to a binary optimized file format. **

In terms of writing parsers for the OBJ and Collada file formats, Wikipedia describes the format well enough that with a simple sample file you can write a loader. Collada, on the other hand, is much more complex. The best information I have found on loading Collada files is this tutorial by Wazim. A bit more information on Collada can be found on Wikipedia, mainly the links to various libraries capable of loading and parsing Collada files. There may also be a link to the spec somewhere in there as well.
However, unless you want the challenge of both writing a Collada importer, and supporting it for the minor variations that different programs produce, your probably better off using a library with an established importer.

** I managed to go from a 1 minute load using raw .obj files to <1 second using a custom binary format that mapped directly to my games Scene object, not to mention the files were about 25% +/- 5% of the size of the original OBJs. I haven't done profiling on Collada yet.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .