File: triangles.Rd

package info (click to toggle)
misc3d 0.9-2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 304 kB
  • sloc: makefile: 2
file content (71 lines) | stat: -rw-r--r-- 3,045 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
\name{triangles}
\alias{makeTriangles}
\alias{updateTriangles}
\alias{scaleTriangles}
\alias{translateTriangles}
\alias{transformTriangles}
\title{Triangle Mesh Functions}
\description{
  Functions to create and modify triangle mesh objects representing 3D
  surfaces..
}
\usage{
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)
transformTriangles(triangles, R)
}
\arguments{
  \item{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 \code{v1} and \code{v2} are provided then
    \code{v1} should be a numeric matrix with three rows specifying
    coordinates of vertices, and \code{v2} should be an integer matrix
    with three rows specifying the indexes of the vertices in the
    triangles.  If only \code{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.}
  \item{triangles}{triangle mesh object.}
  \item{x,y,z}{numeric of length one. Amounts by which to translate or
    scale corresponding coordinates.}
  \item{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.}
  \item{color2}{opposite face color.}
  \item{alpha}{alpha channel level, a number between 0 and 1.}
  \item{fill}{logical; if \code{TRUE}, drawing should use filled
    surfaces; otherwise a wire frame should be drawn.}
  \item{col.mesh}{color to use for the wire frame.}
  \item{smooth}{integer or logical specifying Phong shading level for
    "standard" and "grid" engines or whether or not to use shading for
    the "rgl" engine.}
  \item{material}{material specification; currently only used by
    "standard" and "grid" engines. Currently possible values are the
    character strings "dull", "shiny", "metal", and "default".}
  \item{R}{4 by 4 homogeneous coordinate transformation matrix to apply.}
}
\value{
  A triangle mesh object of class \code{Triangles3D}.
}
\details{
  \code{makeTriangles} creates a triangle mesh object.
  \code{updateTriangles} modifies fields of such an object.  Both may
  perform some consistency checks.

  \code{translateTriangles} and \code{scaleTriangles} translate or scale
  the vertex locations of triangle mesh objects by specified amounts.

  \code{transformTriangles} applies a transformation specified by a 4 by
  4 homogeneous transformation matrix.
}
\keyword{hplot}