rgl.surface               package:rgl               R Documentation

_a_d_d _h_e_i_g_h_t-_f_i_e_l_d _s_u_r_f_a_c_e _s_h_a_p_e

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

   x, z : x,z axis tick marks 

      y : y height values 

    ... : Material and texture properties. See `rgl.material' for
          details.

_D_e_t_a_i_l_s:

     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,
     where the y- (or height) values are defined for each point.

_S_e_e _A_l_s_o:

     `rgl.material'

_E_x_a_m_p_l_e_s:

     #
     # 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 <- rainbow(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)

