Introduction
The X format is Microsoft’s model format for Direct3D, introduced with DirectX in the 1990s. The D3DX helper library in the DirectX SDK could load an X file straight into a mesh, so it was widely used in Windows games and samples of the DirectX 8 and 9 era. A file can hold meshes with normals, texture coordinates and materials, a hierarchy of frames, skin weights and animation.
Microsoft has since retired D3DX and the format with it, and newer engines use FBX or glTF instead. X files still turn up in older games and teaching material.
Structure
Every X file starts with a 16-byte header: the magic xof , a version
such as 0302 or 0303, a format, and the size of floats,
0032 or 0064. The format is txt for text,
bin for binary, or tzip and bzip for compressed
text and binary.
The body is a list of data objects, each an instance of a template. Templates are
declared types such as Frame, FrameTransformMatrix,
Mesh, MeshNormals, MeshTextureCoords,
MeshMaterialList, Material and
AnimationSet. Objects nest, so a frame holds its transform, its meshes and
its child frames.
xof 0303txt 0032
Mesh Triangle {
3;
0.0; 0.0; 0.0;,
1.0; 0.0; 0.0;,
0.0; 1.0; 0.0;;
1;
3; 0, 1, 2;;
}
Links
Software
- DirectX Viewer, part of the legacy DirectX SDK (Windows)
- Autodesk 3ds Max (Windows), with an X exporter plugin
Developers
- Assimp, C++ library that imports dozens of 3D formats, text and binary X files among them