Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Layered COLLADA Loader for OpenGL3.1+ Context

What layers would aid in implementing this efficiently? Preferably such that I am able to get these three components listed below up with the early layers and code the rest as I go.

I am writing a COLLADA loading library to use with my graphics engine. So of course as soon as I began I notice this seems to be a rather large task. I now intend to write the library to use different layers.

I do not yet understand COLLADA. I'm assuming there may be:

  • Geometry layer
  • Shader layer
  • Texure Layer

Even these I'm unsure of, may need to be part of a different sort of layering scheme.

Side note, I will most likely be using irrXML or this interesting XML library I just read about here to read the files unless advised otherwise.

like image 652
Garet Claborn Avatar asked Feb 06 '11 13:02

Garet Claborn


1 Answers

Are you aware of Open Asset Import Library (http://assimp.sourceforge.net/)? It has quite decent support for Collada loading and targets use in graphics engines. Writing a collada loader on your own is not only hard, it also takes ages to get it stable enough for productive use, mostly because the format is terribly complex (or, as the primary author of Assimp's Collada loader jokingly put is: almost turing-complete) and every exporter has its own strange habits.

If you need additional features, you can base your work on Assimp's Collada loader and add just what you need (BSD license, you may take it as long as you attribute the source).

Note: I am affliated with the project and thus not unbiased. But after the horrible experiences we made with writing our own Collada loader, I just feel like having to warn you …

Side note, I will most likely be using irrXML

We use it too. Should you really start from scratch, don't. Use a DOM parser, such as TinyXML. Collada is complex but very well-defined, a SAX parser just hardens the work since you have to build the document tree on your own (and you *will** need a data structure to resemble the full document - Collada elements are highly interconnected. To read something meaningful out of them, various cross references need to be resolved).

like image 109
Alexander Gessler Avatar answered Nov 09 '22 12:11

Alexander Gessler