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 72 73 74 75 76 77 78 79 80 81
|
\name{rgl.attrib}
\alias{rgl.attrib}
\title{
Get information about shapes
}
\description{
Retrieves information about the shapes in a scene.
}
\usage{
rgl.attrib(id, attrib, first = 1,
last = rgl.attrib.count(id, attrib))
}
\arguments{
\item{id}{
A shape identifier, as returned by \code{\link{ids3d}}.
}
\item{attrib}{
An attribute of a shape. Currently supported: one of \cr
\code{"vertices"}, \code{"normals"}, \code{"colors"}, \code{"texcoords"},
\code{"dim"}, \code{"texts"}, \code{"cex"}, \code{"adj"}, \code{"radii"},
\code{"centers"}, \code{"ids"}, \code{"usermatrix"}, \code{"types"},
\code{"flags"}, \code{"offsets"}, \code{"family"}, \code{"font"},
\code{"pos"}\cr
or unique prefixes
to one of those.
}
\item{first, last}{
Specify these to retrieve only those rows of the result.
}
}
\details{
If the identifier is not found or is not a shape that has the given attribute,
zero will be returned by \code{rgl.attrib.count}, and an empty matrix
will be returned by \code{rgl.attrib}.
The first four \code{attrib} names correspond to the usual OpenGL
properties; \code{"dim"} is used just for surfaces, defining the rows
and columns in the rectangular grid; \code{"cex"}, \code{"adj"},
\code{"family"}, \code{"font"} and \code{"pos"} apply only to text objects.
}
\value{
\code{rgl.attrib}
returns the values of the attribute. Attributes
are mostly real-valued, with the following sizes:
\tabular{lll}{
\code{"vertices"} \tab 3 values \tab x, y, z \cr
\code{"normals"} \tab 3 values \tab x, y, z \cr
\code{"centers"} \tab 3 values \tab x, y, z \cr
\code{"colors"} \tab 4 values \tab r, g, b, a \cr
\code{"texcoords"} \tab 2 values \tab s, t \cr
\code{"dim"} \tab 2 values \tab r, c \cr
\code{"cex"} \tab 1 value \tab cex \cr
\code{"adj"} \tab 2 values \tab x, y \cr
\code{"radii"} \tab 1 value \tab r \cr
\code{"ids"} \tab 1 value \tab id \cr
\code{"usermatrix"} \tab 4 values \tab x, y, z, w \cr
\code{"texts"} \tab 1 value \tab text \cr
\code{"types"} \tab 1 value \tab type \cr
\code{"flags"} \tab 1 value \tab flag \cr
\code{"family"} \tab 1 value \tab family \cr
\code{"font"} \tab 1 value \tab font \cr
\code{"pos"} \tab 1 value \tab pos \cr
}
The \code{"texts"}, \code{"types"} and \code{"family"}
attributes are character-valued; the \code{"flags"}
attribute is logical valued, with named rows.
These are returned as matrices with the row count equal to the count for the attribute,
and the columns as listed above.
}
\author{
Duncan Murdoch
}
\seealso{
\code{\link{ids3d}}, \code{\link{rgl.attrib.info}}
}
\examples{
p <- plot3d(rnorm(100), rnorm(100), rnorm(100), type = "s", col = "red")
rgl.attrib(p["data"], "vertices", last = 10)
}
\keyword{ graphics }
|