
Last chance! 50% off unlimited learning
Sale ends in
surface3d(x, y, z, ...)
terrain3d(x, y, z, ...)
z
z
rgl.material
for details.z
, with rows corresponding
to the values in x
and columns corresponding to the values in
y
. This is the same parametrization as used in persp
.
surface3d
always draws the surface with the `front' upwards
(i.e. towards higher z
values). This can be used to render
the top and bottom differently; see rgl.material
and
the example below.
For more flexibility in defining the surface, use rgl.surface
.
surface3d
and terrain3d
are synonyms.rgl.material
, rgl.surface
, persp
#
# volcano example taken from "persp"
#
data(volcano)
z <- 2 * volcano # Exaggerate the relief
x <- 10 * (1:nrow(z)) # 10 meter spacing (S to N)
y <- 10 * (1:ncol(z)) # 10 meter spacing (E to W)
zlim <- range(y)
zlen <- zlim[2] - zlim[1] + 1
colorlut <- terrain.colors(zlen) # height color lookup table
col <- colorlut[ z-zlim[1]+1 ] # assign colors to heights for each point
open3d()
surface3d(x, y, z, color=col, back="lines")
Run the code above in your browser using DataLab