Creating an MDL Model (.mdl)
AGI recommends using glTF models, but supports MDL and COLLADA for backward compatibility with older scenarios.
A model is a graphical representation of an object. You define that graphical representation in a model file which is an ASCII text file with an
.mdl
extension (for example,
sample.mdl
).
You may need to build or modify an MDL model file (.mdl) if you:
- Work in a classified environment
- Need to add an attach point or an articulation
- Require a new design
Model files are arranged in a hierarchy of components. A component can contain primitives that define the shape of the component (such as a polygon or a cylinder), parameters that describe it in some way (such as color or shininess), or primitives that refer to other components. In the hierarchy, the component is the parent of all primitives and subcomponents contained within. A primitive that refers to a component is the parent of that component.
A model file contains the following:
- Description. A detailed description of the model.
- Components. Each component describes a specific part of the model, such as an antenna dish. Some models contain levels of detail that can be used to display the model as more or less complex.
- Primitives. A component contains one or more primitives that define the shape of the component.
- Parameters. Parameters are used to further describe a primitive or component.
The basic units in an MDL model file are specified in meters. However, you can build a model using a different unit of measure, as long as you add the command UniformScale <value> to the root component (or any upper-level component) in the model file to convert the units you used to meters. Use the following UniformScale values to convert inches, feet, and centimeters to meters.
Unit | UniformScale Value |
---|---|
centimeters | UniformScale 0.01 |
inches | UniformScale 0.0254 |
feet | UniformScale 0.3048 |