triangles               package:misc3d               R Documentation

_T_r_i_a_n_g_l_e _M_e_s_h _F_u_n_c_t_i_o_n_s

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

     Functions to create and modify triangle mesh objects representing
     3D surfaces..

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

     makeTriangles(v1, v2, v3, color = "red", color2 = NA, alpha = 1,
                   fill = TRUE, col.mesh = if (fill) NA else color,
                   smooth = 0, material = "default")
     updateTriangles(triangles, color, color2, alpha, fill, col.mesh,
                     material, smooth)
     translateTriangles(triangles, x = 0, y = 0, z = 0)
     scaleTriangles(triangles, x = 1, y = x, z = x)

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

v1,v2,v3: specification of triangle coordinates. If all three are
          provided then they should be matrices with three columns
          representing coordinates of the first, second, and third
          vertices of the triangles.  If only 'v1' and 'v2' are
          provided then 'v1' should be a numeric matrix with three rows
          specifying coordinates of vertices, and 'v2' should be an
          integer matrix with three rows specifying the indexes if the
          vertices in the triangles.  If only 'v1' is provided then it
          should be a matrix with three columns and number of rows
          divisible by three specifying the vertices of the triangles
          in groups of three.

triangles: triangle mesh object.

   x,y,z: numeric of length one. Amounts by which to translate or scale
          corresponding coordinates.

   color: color to use for the surface. Can also be a function of three
          arguments.  This is called with three arguments, the
          coordinates of the midpoints of the triangles making up the
          surface. The function should return a vector of colors to use
          for the triangles.

  color2: opposite face color; only used for "standard" and "grid"
          engines.

   alpha: alpha channel level, a number between 0 and 1.

    fill: logical; if 'TRUE', drawing should use filled surfaces;
          otherwise a wire frame should be drawn.

col.mesh: color to use for the wire frame.

  smooth: integer specifying Phong shading level; currently only used
          by "standard" and "grid" engines.

material: material specification; currently only used by "standard" and
          "grid" engines. Currently possible values are the character
          strings "dull", "shiny", "metal", and "default".

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

     'makeTriangles' creates a triangle mesh object. 'updateTriangles'
     modifies fields of such an object.  Both may perform some
     consistency checks.

     'translateTriangles' and 'scaleTriangles' translate or scale the
     vertex locations of triangle mesh objects by specified amounts.

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

     A triangle mesh object of class 'Triangles3D'.

