Since I noticed some interest here and there, I spent a few days learning C# and XNA express, and as a result I am ready to contribute a COLLADA loader for the XNA pipeline.
This zip contains two C# projects:
- COLLADA document, which is a pure C# fine (no XNA involved) that can be used in any C# application to load a COLLADA document in memory. It is not complete, since I only implemented what I needed so far, but a good start !
- COLLADA pipeline, which is using COLLADA document, and implement a XNA pipeline for XNA.
XNA pipeline is in 2 stages. The Importer and the processor.
In the Importer, this will load the COLLADA document in memory, and then apply a conditioner (a simple convex mesh triangulation is included), and then can save it as a binary file (serialization).
In the processor, this will convert COLLADA document (loaded back from binary) into a NodeContent using Basic Material.
In order to load COLLADA documents in your XNA application, simply add the COLLADAPipeline.dll in the ‘Content Pipeline Assemblies’ properties of the ‘Content Pipeline’. double-click on the properties in your solution explorer to get this option.
IE users: view entire image
Then you will have to make sure the .dae files are added to your content in the project, and that you have associated the right content pipeline tools for it. Then you can use the regular content.Load<Model>() call to get your COLLADA models in your XNA application, just like you do with the embedded .fbx and .x loaders
IE users: view entire image
For your convenience, here is a sample XNA viewer application, including some models that I grabbed from the COLLADA file repository.
What’s next?
Well, I am not sure. I am waiting for feedback to see what we should do next. But the one think I am not sure of, unless I am missing something, is that the XNA pipeline forces you into using XNA sealed classes, that I do not see how the pipeline can be extended to understand what is a Bezier spline, a line primitive, a morph or skinned character, or a physics scene.
Say, if I wanted to do a complete COLLADA viewer, it seems that it would have to be done without using the XNA pipeline ?