Skip to content

ColladaXna – COLLADA Importer for XNA 4

As you can read in my previous posts I’ve been working on a library for loading and rendering animated COLLADA models in XNA 4.0. For this purpose I had created a Codeplex project (http://omixna.codeplex.com/).

However, I realized that the project had too broad a focus. I were not only importing the COLLADA files, I also (partly) implemented the “loading” (i.e. content processing) and “rendering” (Shader generation, animation and render calls in XNA). Furthermore all this was based upon a custom content model and classes.

This week I decided to limit my focus on the import process, leaving out all the rest. For this reason I forked a new project from the old one at GitHub (https://github.com/Bunkerbewohner/ColladaXna/wiki) which I now call “ColladaXna”. This library imports COLLADA models (based on the code of the old project) into the XNA default content model. Therefore the default Model processor and Model class can be used to load and draw the models.

COLLADA Models

COLLADA Models imported using ColladaXna and rendered with XNA's BasicEffect

Using the default content model also allows making use of other libraries or engines to take care of rendering and animation without having to adjust them to my own Model classes. Even though some features such as Normal Maps and Skinned Mesh Animation can be stored in XNA’ s default content model, they are not supported by the standard Model class and BasicEffect. Therefore my hope is that other libraries or engines (such as SunBurn) can take care of rendering and animating the models for me. Of course you always can implement this stuff on your own. The XNA Creator’s Club education catalogue contains samples for implementing Normal Mapping and Skinned Mesh Animation, which use the default content model, and therefore are actually compatible to COLLADA models imported through ColladaXna.

The new library is not yet entirely ready to be used since I still have to find out how to convert some of the data (such as animations) correctly to the default content model. Basic non-animated models do already work, though, as can be seen in the screenshot above. I created “Issues” on GitHub for the things that are still left to do. The entire Visual Studio solution including a working sample application that renders a few test models can be cloned from the Git repository on GitHub.

By the way there has been an excellent COLLADA Importer implementation around for several years, which was created by Rémi Arnaud (https://collada.org/public_forum/viewtopic.php?f=13&t=676&start=30). Unfortunately its development obviously wasn’t continued and some important features are still missing. My guess is, that it was a bit ahead of its time. I only rediscovered the project recently and was amazed at how much better his code is than mine. I still got much to learn!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

My Del.icio.us

%d bloggers like this: