rgl.surface {rgl}R Documentation

add height-field surface shape

Description

Adds a surface to the current scene. The surface is defined by two grid mark vectors and a matrix defining the height of each grid point.

Usage

rgl.surface(x, z, y, ...)

Arguments

x, z x,z axis tick marks
y y height values
... Material and texture properties. See rgl.material for details.

Details

Adds a surface mesh to the current scene. The surface is evaluated by defining the x- and z-axis tick marks for the control grid. The matrix y defines the height values for each point.

See Also

rgl.material

Examples


#
# volcano example taken from "persp"
#

data(volcano)

y <- 2 * volcano        # Exaggerate the relief

x <- 10 * (1:nrow(y))   # 10 meter spacing (S to N)
z <- 10 * (1:ncol(y))   # 10 meter spacing (E to W)

ylim <- range(y)
ylen <- ylim[2] - ylim[1] + 1

colorlut <- terrain.colors(ylen) # height color lookup table

col <- colorlut[ y-ylim[1]+1 ] # assign colors to heights for each point

rgl.clear()
rgl.surface(x, z, y, color=col)


[Package rgl version 0.64-13 Index]