1.6.3. SoHeightFieldProperty

The SoHeightFieldProperty SoHeightFieldProperty SoHeightFieldProperty node is also analogous to (and derived from) SoVolumeData SoVolumeData SoVolumeData . This node defines a set of values on a uniform grid in the XY plane that can be used to color the height field defined by an SoHeightFieldGeometry SoHeightFieldGeometry SoHeightFieldGeometry node when rendered using an SoHeightFieldRender SoHeightFieldRender SoHeightFieldRender node. Similar to SoHeightFieldGeometry SoHeightFieldGeometry SoHeightFieldGeometry , a height field property data set is a volume, whose Z dimension must be 1. The volume can be loaded using any of the usual mechanisms.

An SoHeightFieldProperty SoHeightFieldProperty SoHeightFieldProperty node is not required to render a height field. If there is no property associated with the height field, it will be rendered using the current material (see SoMaterial SoMaterial SoMaterial ) like any other geometry. If you want to map the height values themselves to colors, create an SoHeightFieldProperty SoHeightFieldProperty SoHeightFieldProperty node and set its volume to the same values as the SoHeightFieldGeometry SoHeightFieldGeometry SoHeightFieldGeometry node. For example, if the height values are loaded from a data file on disk, simply set the fileName field to the same string as the SoHeightFieldGeometry SoHeightFieldGeometry SoHeightFieldGeometry node.

Typically the property volume will contain scalar values and those values will be mapped to colors using the current data range (see SoDataRange SoDataRange SoDataRange ) and color map (see SoTransferFunction SoTransferFunction SoTransferFunction ). However the property volume may contain RGBA values, for example aerial imagery to be draped over terrain.

No property

Figure 1.71. No property



Property = height values

Figure 1.72. Property = height values



Property = RGBA image

Figure 1.73. Property = RGBA image



Terrain (LIDAR) data

Multiple SoHeightFieldProperty SoHeightFieldProperty SoHeightFieldProperty nodes can be inserted in a scene graph and combined together in the GPU to do render compositing. However the default fragment shader only handles one property (the first one). To combine multiple properties use a custom shader program (see SoVolumeShader SoVolumeShader SoVolumeShader and Section 1.8, “Shaders”).

It is not necessary (or useful) to set the extent field. SoHeightFieldRender SoHeightFieldRender SoHeightFieldRender will automatically use the extent associated with the SoHeightFieldGeometry SoHeightFieldGeometry SoHeightFieldGeometry node.