Skip to content
Bunkerbewohner edited this page Aug 21, 2011 · 3 revisions

The GeometryImporter is responsible for importing any meshes defined in the COLLADA document. Note that COLLADA also supports other geometry representations (such as NURBS), which are currently not supported by this library. However, most content creation tools should be able to export models as simple 3D meshes.

The importer expects triangulated geometry, since XNA does not support more complex polygons natively. In future a triangulation algorithm could be added to this library to handle arbitrary meshes. Until then models must be exported to COLLADA as triangulated meshes to be compatible to this library. This means that only the following COLLADA geometry elements are currently supported:

  • <triangles>

  • <polygons> (must be 3-gons)

  • <polylist> (must be a list of 3-gons)

Each mesh is imported along with its assigned material name which can be used to access used materials from the material library (see MaterialImporter).

Vertex Channels

The following COLLADA vertex channels are supported and correctly imported. The corresponding XNA VertexElementUsage is given in brackets.

  • VERTEX / POSITION (VertexElementUsage.Position)
  • COLOR (VertexElementUsage.Color)
  • NORMAL (VertexElementUsage.Normal)
  • TEXCOORD (VertexElementUsage.TextureCoordinate)
  • TEXTANGENT (VertexElementUsage.Tangent)
  • TEXBINORMAL (VertexElementUsage.Binormal)
  • JOINT (VertexElementUsage.BlendIndices)
  • WEIGHT (VertexElementUsage.BlendWeights)

Each channel may occur multiple times and is imported with the appropriate UsageIndex. However, to comply with defacto standards in XNA regarding Skinned Mesh Animations, the JOINT and WEIGHT channels are transformed into a single vertex channel consisting of BoneWeightCollection items. Therefore only the first occuring pair of JOINT and WEIGHT channels are considered. If you need more than one channel for this or want to import individual float-based channels for indices and weights, you can adjust this behaviour in a Custom Content Importer.

Currently only vertex channels using float values are considered and imported as Single, Vector2, Vector3, and Vector4 types. In theory other types of values are possible. Support for these is easily implemented, but didn't seem to be neccessary so far.

Clone this wiki locally