Description Usage Arguments Details Value See Also Examples
Canopies or Volumes viewed in 3D using rgl
package features.
1 2 3 4 5 6 7 |
data |
A |
... |
Further potential arguments passed to
|
color |
A color character or a polygon label to use to colorize the 3D scene. |
fraction |
The fraction of rows to select. |
label |
Display ("levels" or "indices") or no display ("no") labels for each volume. "levels" displays "labels" consisting of the volume ID and "indices", just a number, corresponding to the row number. |
This function is basically a wrapper of shapelist3d
(package rgl
) with a seamless interface with Canopy
objects
(returned by the function readCan
) or VolumeSet
objects
(returned by the function makeVolumeSet
).
Note that the plotting process may be time-consuming with a large number of
polygons. Consider using the parameter fraction
when plotting a
Canopy
to only select a random subset of all the polygons.
An object of class c("shapelist3d", "shape3d")
.
shapelist3d
in the rgl
package for a more
detailed explanation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | display3d(plants)
display3d(plants, frac = 0.1)
display3d(plants, col = rgb(0, 0.7, 0))
display3d(plants, col = "green4", alpha = 0.3)
display3d(plants, col = "plantID")
rangeDim <- function(can, dim) {
range(sapply(can$vertices, function(i) range(i[, dim])))
}
volumes <- makeVolumeSet(rangeDim(plants, "x"),
rangeDim(plants, "y"),
rangeDim(plants, "z"),
intervals = rep(3, 3))
display3d(volumes)
display3d(volumes, color = rgb(0.7, 0, 0.7), alpha = 0.3)
display3d(volumes, color = "red", alpha = 0.3)
display3d(volumes, color = "volumeID")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.