rgl.material               package:rgl               R Documentation

_G_e_n_e_r_i_c _A_p_p_e_a_r_a_n_c_e _s_e_t_u_p

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

     Set material properties for geometry appearance.

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

     rgl.material(
       color        = c("white"),
       alpha        = c(1.0),
       lit          = TRUE, 
       ambient      = "black",
       specular     = "white", 
       emission     = "black", 
       shininess    = 50.0, 
       smooth       = TRUE,
       texture      = NULL, 
       textype      = "rgb", 
       texmipmap    = FALSE, 
       texminfilter = "linear", 
       texmagfilter = "linear",
       texenvmap    = FALSE,
       front        = "fill", 
       back         = "fill",
       size         = 1.0, 
       fog          = TRUE, 
       ...
     )
     material3d(...)

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

   color: vector of R color characters. Represents the diffuse
          component in case of lighting calculation (lit = TRUE),
          otherwise it describes the solid color characteristics. 

     lit: logical, specifying if lighting calculation should take place
          on geometry 

ambient, specular, emission, shininess: properties for lighting
          calculation. ambient, specular, emission are R color
          character string values; shininess represents a numerical. 

   alpha: vector of alpha values between 0.0 (fully transparent) .. 1.0
          (opaque). 

  smooth: logical, specifying whether gourad shading (smooth) or flat
          shading should be used. 

 texture: path to a texture image file. Supported formats: png. 

 textype: specifies what is defined with the pixmap

          "_a_l_p_h_a" alpha values

          "_l_u_m_i_n_a_n_c_e" luminance

          "_l_u_m_i_n_a_n_c_e._a_l_p_h_a" luminance and alpha

          "_r_g_b" color

          "_r_g_b_a" color and alpha texture

texmipmap: Logical, specifies if the texture should be mipmapped. 

texmagfilter: specifies the magnification filtering type (sorted by
          ascending quality):

          "_n_e_a_r_e_s_t" texel nearest to the center of the pixel

          "_l_i_n_e_a_r" weighted linear average of a 2x2 array of texels

texminfilter: specifies the minification filtering type (sorted by
          ascending quality):

          "_n_e_a_r_e_s_t" texel nearest to the center of the pixel

          "_l_i_n_e_a_r" weighted linear average of a 2x2 array of texels

          "_n_e_a_r_e_s_t._m_i_p_m_a_p._n_e_a_r_e_s_t" low quality mipmapping

          "_n_e_a_r_e_s_t._m_i_p_m_a_p._l_i_n_e_a_r" medium quality mipmapping

          "_l_i_n_e_a_r._m_i_p_m_a_p._n_e_a_r_e_s_t" medium quality mipmapping

          "_l_i_n_e_a_r._m_i_p_m_a_p._l_i_n_e_a_r" high quality mipmapping

texenvmap: logical, specifies if auto-generated texture coordinates for
          environment-mapping  should be performed on geometry. 

front, back: Determines the polygon mode for the specified side:

          "_f_i_l_l" filled polygon

          "_l_i_n_e" wireframed polygon

          "_p_o_i_n_t_s" point polygon

          "_c_u_l_l" culled (hidden) polygon

    size: numeric, specifying the line and point size. 

     fog: logical, specifying if fog effect should be applied on the
          corresponding shape

     ...: Any of the arguments above; see Details below.

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

     Only one side at a time can be culled.

     'material3d' is an alternate interface to the material properties,
     modelled after 'par3d':  rather than setting defaults for
     parameters that are not specified,  they will be left unchanged. 
     'material3d' may also be used to query the material properties;
     see the examples below.

     The current implementation does not return parameters for
     textures.

     The '...' parameter to 'rgl.material' is ignored.

_V_a_l_u_e:

     'rgl.material()' is called for the side effect of setting the
     material properties. It returns a value invisibly which is not
     intended for use by the user.

     Users should use 'material3d()' to query material properties.  It
     returns values similarly to 'par3d' as follows: When setting
     properties, it returns the previous values in a named list.  A
     named list is also returned when more than one value is queried. 
     When a single value is queried it is returned  directly.

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

     'rgl.primitive', 'rgl.bbox', 'rgl.bg', 'rgl.light'

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

     save <- material3d("color")
     material3d(color="red")
     material3d("color")
     material3d(color=save)

