Go to: Related nodes. Attributes.

This transform node is a group node that can be used to detect how close a group of objects is to a camera. Typically this node is used for controlling "Level of Detail" visibility. With "Level of Detail", the visibility of the children of this transform are controlled by the distance of a group to a camera and the threshold values. The visibility can also be controlled by the screen height percentage of a group, as projected onto the screen.

For example, under a LOD group node, there are three children: ship_detailed, ship_medium, and ship_rough. There are two threshold values: 5, and 10. When the camera is within 5 units of the group bounding box, only ship_detailed is visible. When the view is zoomed out and the camera is 9 units away from the group, only ship_medium is visible. When the view is zoomed out to 11 units away, only ship_rough is visible.

As an example of using screen height percentage, under a LOD group node, there are three children: cone_detailed, cone_medium, and cone_rough. There are two percentageThreshold values: 50, and 10. The group bounding box is projected into screen space, and its height is compared to that of the screen. If the value is more than 50 percent, then only cone_detailed is visible. When the view is zoomed out, and the projected screen height of the bounding box is between 50 and 10 percent, only cone_medium is visible. Finally, when the camera is zoomed out such that the projected screen height is less than 10 percent, only cone_rough is visible.

See also documentation on the "Level Of Detail" feature.

Node nameParentsClassificationMFn typeCompatible function sets
lodGrouptransformauxiliary/camera:drawdb/geometry/transformkLodGroupkBase
kNamedObject
kDependencyNode
kDagNode
kTransform
kLodGroup

Related nodes

groupParts, groupId, makeGroup, baseGeometryVarGroup, meshVarGroup, geometryVarGroup, curveVarGroup, surfaceVarGroup, tweak

Attributes (14)

activeLevel, cameraMatrix, displayLevel, distance, focalLength, maxDistance, minDistance, minMaxDistance, output, percentageThreshold, screenHeightPercentage, threshold, useScreenHeightPercentage, worldSpace

Long name (short name)TypeDefaultFlags
activeLevel (al) integer0outputinputconnectable
The currently active level. For example, if the distance between the group and the camera is smaller than the first threshold, then the active level is 0.
cameraMatrix (cm) matrixidentityoutputinputconnectablestorable
Transformation matrix to put the camera position into world space
displayLevel (dl) enum0arrayoutputinputconnectablestorablekeyable
Overrides the display of any level and can force it to hide or show the object at that level. For example, if the distance between the group and the camera is smaller than the first threshold, then the object at level 0 is visible. If the display level for the object at level 2 is changed to "show", ie. if the attribute displayLevel[2] is set to "show", then the object at level 2 will show, regardless of the current active level.
distance (d) distance (double)0.0cmoutputinputconnectable
Distance calculated between the camera and the group node's bounding box.
focalLength (fl) double0.0outputinputconnectable
Camera focal length in millimeters; needed for screen height percentage to be able to refresh when camera's focal length changes.
maxDistance (mxd) double100.0outputinputconnectablestorablekeyable
The maximum distance at which the group is displayed.
minDistance (mid) double-100.0outputinputconnectablestorablekeyable
The minimum distance at which the group is displayed.
minMaxDistance (mmd) bool0outputinputconnectablestorablekeyable
Enables the minimum and maximum distance to take effect. For example, if the distance between the group and the camera is smaller than the minimum distance, then the whole group disappears.
output (o) boolfalsearrayoutputconnectable
Multi-attribute whose members are enabled based on the distance between the camera and the group node's bounding box. For example, if the distance between the group and the camera is smaller than the first threshold, then the attribute output[0] is TRUE. All other output attributes are false. When the active level changes to 1, then the attribute output[1] is TRUE, and all others are false.
percentageThreshold (pth) double0.0arrayoutputinputconnectablestorablekeyable
List of values that indicate ranges. Ranges are defined by: range[0]: outLevel[0] to 100 range[1]: outLevel[1] to outLevel[0] etc. For example, the first child under this group node will be displayed when the camera is in the first range.
screenHeightPercentage (shp) double0.0outputinputconnectable
Screen height percentage calculated occupied by the group node's bounding box.
threshold (th) distance (double)0.0cmarrayoutputinputconnectablestorablekeyable
List of values that indicate ranges. Ranges are defined by: range[0]: 0 to outLevel[0] range[1]: outLevel[0] to outLevel[1] etc. For example, the first child under this group node will be displayed when the camera is in the first range.
useScreenHeightPercentage (ush) bool0outputinputconnectablestorable
If true, use screen height percentage thresholds instead of distance from camera. If this attribute is set to false, the camera distance will be used to select the level.
worldSpace (ws) bool1outputinputconnectablestorable
Work in world space of transform or local space If true, the camera distance to the LOD group will be computed in world space. This means it is possible to parent the LOD transform below other transforms and still have it work as expected. If this attribute is set to false, the distance computation ignores any parent transforms of the LOD transform.