Visualizing terrain

VisIt can read a variety of elevation data formats such as DEM through its GDAL file format reader. The GDAL reader for VisIt provides access to the height variable as well as various elevated versions of it and lower resolution versions of it. When setting up a visualization, it is often helpful to use the lower resolution versions since they can be computed more quickly. Depending on the resolution of the data, the GDAL reader may break it up into strips that can be worked on separately by multiple processors when parallel VisIt is used.

Useful features

Terrain data are often represented as height values on a regular grid or image. That height data can be used to elevate the grid into into 3D using VisIt's Elevate operator. Elevation lines can be created using the Contour plot or Pseudocolor plot with an Isosurface operator.

If you want the images to look realistic, then you could elevate a color satellite image by the height data from another file. You would do this first by plotting the color data using a Truecolor plot. Next, you would use VisIt's CMFE functions to sample the height data onto the same grid as the color data. Once that's done, you can use the Elevate operator to elevate the colored terrain by the height data.

For extra hints of realism, play with the specular settings and shadow settings in VisIt's Rendering options window. Or, use a Volume plot to add wispy clouds.

Example with 4 plots

This example shows how 4 plots can be used with VisIt's operators to create a visualization with several depictions of the terrain height data. VisIt's Python interface is used to describe the visualization setup, although the same operations could be performed in VisIt's GUI.

Gallery15.jpg

OpenDatabase("~/data/DEM/10.2.1.1043901.dem")

# Draw the ground plot.
AddPlot("Pseudocolor", "height")
AddOperator("Elevate", 0)
e = ElevateAttributes()
e.zeroFlag = 1
SetOperatorOptions(e)

# Draw the elevated pseudocolor plot
AddPlot("Pseudocolor", "elevated/mesh/height")
p1 = PseudocolorAttributes()
p1.legendFlag = 0
SetPlotOptions(p1)
AddOperator("Transform", 0)
t1 = TransformAttributes()
t1.doScale = 1
t1.scaleOrigin = (0, 0, 0)
t1.scaleX = 1
t1.scaleY = 1
t1.scaleZ = 0.4
t1.doTranslate = 1
t1.translateX = 0
t1.translateY = 0
t1.translateZ = 3000
SetOperatorOptions(t1, 0)

# Draw the red contour plot
AddPlot("Contour", "height")
AddOperator("Transform", 0)
t2 = TransformAttributes()
t2.doRotate = 1
t2.rotateAxis = (1,0,0)
t2.rotateAmount = 0.000001
t2.doTranslate = 1
t2.translateX = 0
t2.translateY = 0
t2.translateZ = 8000
SetOperatorOptions(t2, 0)
c = ContourAttributes()
c.colorType = c.ColorBySingleColor
c.legendFlag = 0
SetPlotOptions(c)

# Add the elevated, colored contour
AddPlot("Pseudocolor", "elevated/mesh/height")
p2 = PseudocolorAttributes()
p2.legendFlag = 0
SetPlotOptions(p2)
AddOperator("Transform", 0)
AddOperator("Isosurface", 0)
t2 = TransformAttributes()
t2.doScale = 1
t2.scaleOrigin = (0, 0, 0)
t2.scaleX = 1
t2.scaleY = 1
t2.scaleZ = 0.4
t2.doTranslate = 1
t2.translateX = 0
t2.translateY = 0
t2.translateZ = 10500
SetOperatorOptions(t2, 0)

# Draw the plots
DrawPlots()

# Draw the purple gradient background
a = AnnotationAttributes()
a.userInfoFlag = 0
a.backgroundColor = (0, 0, 0, 255)
a.foregroundColor = (255, 255, 255, 255)
a.gradientBackgroundStyle = a.TopToBottom  # TopToBottom, BottomToTop, LeftToRight, RightToLeft, Radial
a.gradientColor1 = (0, 0, 0, 255)
a.gradientColor2 = (128, 0, 128, 255)
a.backgroundMode = a.Gradient  # Solid, Gradient, Image, ImageSphere
SetAnnotationAttributes(a)

# Set the view
View3DAtts = View3DAttributes()
View3DAtts.viewNormal = (0.716309, 0.623883, 0.312523)
View3DAtts.focus = (562710, 5.11498e+06, 7173.4)
View3DAtts.viewUp = (-0.232994, -0.208325, 0.949902)
View3DAtts.viewAngle = 30
View3DAtts.parallelScale = 11154.3
View3DAtts.nearPlane = -22308.6
View3DAtts.farPlane = 22308.6
View3DAtts.imagePan = (0, 0)
View3DAtts.imageZoom = 1
View3DAtts.perspective = 1
View3DAtts.eyeAngle = 2
View3DAtts.centerOfRotationSet = 0
View3DAtts.centerOfRotation = (562710, 5.11498e+06, 7173.4)
View3DAtts.axis3DScaleFlag = 0
View3DAtts.axis3DScales = (1, 1, 1)
View3DAtts.shear = (0, 0, 1)
SetView3D(View3DAtts)