bg                    package:rgl                    R Documentation

_S_e_t _u_p _B_a_c_k_g_r_o_u_n_d

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

     Setup the background environment of the scene.

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

     bg3d(...) 
     rgl.bg( sphere = FALSE, fogtype = "none", color=c("black","white"), 
             back="lines", ...)

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

 fogtype: fog type:

          "_n_o_n_e" no fog

          "_l_i_n_e_a_r" linear fog function

          "_e_x_p" exponential fog function

          "_e_x_p_2" squared exponential fog function

  sphere: logical, if true, an environmental sphere geometry is used
          for the background decoration. 

   color: Primary color is used for background clearing and as fog
          color. Secondary color is used for background sphere
          geometry. See 'rgl.material' for details. 

    back: Specifies the fill style of the sphere geometry. See
          'rgl.material' for details. 

    ... : Material properties. See 'rgl.material' for details.

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

     If sphere is set to TRUE, an environmental sphere enclosing the
     whole scene is drawn.

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

     'rgl.material'

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

       rgl.open()
       
       # a simple white background
       
       bg3d("white")

       # the holo-globe (inspired by star trek):

       rgl.bg(sphere=TRUE, color=c("black","green"), lit=FALSE, back="lines" )

       # an environmental sphere with a nice texture.

       rgl.bg(sphere=TRUE, texture=system.file("textures/sunsleep.png", package="rgl"), 
              back="filled" )

