Share via


Recommendations for Developing Custom Importers 

This topic describes a set of best practices for writing custom importers. Though you are not required to follow any of these practices, ignoring them might result in developers not recognizing your importer's output.

General Tips and Strategies

  • Whenever possible, your importer should output data using the basic types provided by the Content DOM. This strategy develops a well-defined set of types that other developers can use and easily recognize when working with your importer in their projects. For more information on the types supported by the Content DOM, see XNA Framework Content Pipeline Graphics.
  • Take advantage of the classes designed to ease the importation of a standard mesh. MeshBuilder provides functionality to quickly import and output a mesh object using the standard Graphics DOM types. MeshHelper and MeshContent also provide methods for mesh-related operations

Importing Basic Graphics Objects

Follow these rules when importing basic graphics objects.

  • Make your coordinate system right-handed. This means that, to the observer, the positive x-axis points to the right, the positive y-axis points up, and the positive z-axis points toward you (out from the screen).
  • Create triangles that have a clockwise winding order. The default culling mode removes triangles that have a counterclockwise winding order. Call SwapWindingOrder to change the winding order of a triangle.
  • Set the scale for graphical objects to 1 unit = 1 meter. Call TransformScene to change the scale of an object.

See Also

Developing a Custom Importer
Content Pipeline Overviews