Units of Measurement
See Also: Units of Measurement Reference.
This section discusses how developers work with the units of measurement used by 3ds max.
3ds max allows users to work with units that they are most comfortable with. Users may specify that they wish to work in US Standard units (Inches, Feet, Miles) or Metric units (Millimeters, Centimeters, Meters or Kilometers). Or they may specify a custom setting (for example perhaps they want to work in fathoms). Users may also work with generic units (these are the same as the default 3ds max master units).
Internally 3ds max keeps track of all measurements in its own internal unit called the master unit. The program converts measurements from user-defined units into the master defined unit for storage and computation. The master unit is defined as 1.0 inch. The user is able to change this master unit using Customize/Preferences, selecting the General page, and adjusting the System Unit Scale controls.
To retrieve the current unit display information one can use GetUnitDisplayInfo().This returns the information describing MAX's current system of measurement. This includes the type of units used, how they are displayed and custom unit name and scale. A developer may also use SetUnitDisplayInfo(). This allows the developer to control the unit settings.
Two functions are available for converting units in and out of ASCII form. These are FormatUniverseValue()and DecodeUniverseValue(). FormatUniverseValue() converts the specified value to its ASCII representation using the current unit display settings. DecodeUniverseValue() parses the specified measurement string and converts it to a floating point value.
Developers can use the method GetMasterScale(int type) to retrieve the master scale in terms of the specified unit type. For example: GetMasterScale(UNITS_INCHES) returns the number of inches per unit (unless altered by the user this would be 1.0).
To review the methods discussed above in detail see the section Units of Measurement Reference.