This past week I spent working on a JiBX based Collada 1.4.1 importer for Ardor3D. It's up and working here locally now, able to load in various test models as well as Collada models from the SketchUp warehouse.
My experience with JiBX thus far has been mixed. There are some things it just does not seem to handle well, particularly in the complicated xml structure that is the Collada spec. For example, the Collada spec has several areas where you have a set of possible choices that can repeat and be in any order. For example, you can have something like:
<COLLADA>
<library_nodes>...</libary_nodes>
<library_images>...</libary_images>
<library_images>...</libary_images>
<library_nodes>...</libary_nodes>
...
</COLLADA>
JiBX can handle that, but only if you handle every possible tag... Because they repeat and are unordered and are not grouped under individual named parent tags, you can't (as far as I can tell) tell it, "only handle library_nodes tags when you parse this section." You also can't even tell it "library_images might be a choice in there, but go ahead and ignore it." No, you have to tell it to handle each one.
I'm also using the Eclipse plugin to handle JiBX bind operations... which is great. But when I went to use the jibx extras jar to get Dom marshalling support, I couldn't seem to get the plugin to find the class definitions. I need Dom support because there are tags in the collada spec that support "any valid xml" under them.
Still, I do enjoy JiBX. The JiBX based Ardor3D Collada loader is much lighter and even a bit faster than the old jme one. So far I have support for triangles, polygons, and polylists. Also proper transforms, phong/blinn materials, textures and some basic transparency. Look for it in the public svn repo "soon" as ardor3d-collada.

Post a Comment