File: spheres.Rd

package info (click to toggle)
rgl 0.80-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 5,508 kB
  • ctags: 10,065
  • sloc: ansic: 27,581; cpp: 14,088; sh: 3,062; makefile: 103
file content (43 lines) | stat: -rw-r--r-- 1,539 bytes parent folder | download | duplicates (3)
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
\name{spheres}
\alias{rgl.spheres}
\alias{spheres3d}
\title{add sphere set shape}
\description{
  Adds a sphere set shape node to the scene
}
\usage{
spheres3d(x, y = NULL, z = NULL, radius = 1, ...)
rgl.spheres(x, y = NULL, z = NULL, radius, ...)
}
\arguments{
  \item{x, y, z}{Numeric vector of point coordinates corresponding to
   the center of each sphere.  Any reasonable way of defining the
    coordinates is acceptable.  See the function \code{\link[grDevices]{xyz.coords}}
    for details.}
  \item{radius}{Vector or single value defining the sphere radius/radii}
  \item{ ... }{Material properties. See \code{\link{rgl.material}} for details.}
}
\details{
If a non-isometric aspect ratio is chosen, these functions will still draw
objects that appear to the viewer to be spheres.  Use \code{\link{ellipse3d}} 
to draw shapes that are spherical in the data scale.

When the scale is not isometric, the radius is measured in an average scale.
Note that the bounding box calculation is always done assuming an 
isometric scale, so in this case it is inaccurate:  the extent of axes 
with \code{scale < 1} is underestimated, and that of axes with 
\code{scale > 1} is overestimated.

If any coordinate or radius is \code{NA}, the sphere is not plotted.
} 
\value{
  A shape ID of the spheres object is returned.
}
\examples{
open3d()
spheres3d(rnorm(10), rnorm(10), rnorm(10), radius=runif(10), color=rainbow(10))
}
\seealso{
  \code{\link{rgl.material}}, \code{\link{aspect3d}} for setting non-isometric scales
}
\keyword{dynamic}