1.6.3. SoHeightFieldProperty

The SoHeightFieldProperty( C++ | Java | .NET ) node is also analogous to (and derived from) SoVolumeData( C++ | Java | .NET ). 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( C++ | Java | .NET ) node when rendered using an SoHeightFieldRender( C++ | Java | .NET ) node. Similar to SoHeightFieldGeometry( C++ | Java | .NET ), 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( C++ | Java | .NET ) 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( C++ | Java | .NET )) like any other geometry. If you want to map the height values themselves to colors, create an SoHeightFieldProperty( C++ | Java | .NET ) node and set its volume to the same values as the SoHeightFieldGeometry( C++ | Java | .NET ) 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( C++ | Java | .NET ) node.

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




Terrain (LIDAR) data

Multiple SoHeightFieldProperty( C++ | Java | .NET ) 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( C++ | Java | .NET ) and Section 1.8, “Shaders”).

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