6.5. Color scale

The SbTVizColorScale class provides an alternative to texture mapping. It specifies a color scale to be applied to a range of elevation values. The terrain is sub-divided into slices of different colors. The number of threshold altitudes should be the number of given colors plus one.

Two additional colors can be set: the extreme colors corresponding to altitudes out of the scale range, above the maximum height and below the minimum height given.

Then two different modes are available: shown on the left, the color contouring mode maps a 1D texture onto the elevations, and makes an accurate sliced representation; shown on the right, the color shading mode sends a color per vertex, producing a smoother color appearance.



Example 6.4. A simple example using color scale