display3d: Plot a canopy or a set of volumes in 3D

Description Usage Arguments Details Value See Also Examples

Description

Canopies or Volumes viewed in 3D using rgl package features.

Usage

1
2
3
4
5
6
7
display3d(data, ...)

## S3 method for class 'Canopy'
display3d(data, color, fraction = 1, ...)

## S3 method for class 'VolumeSet'
display3d(data, color, label = "no", ...)

Arguments

data

A c("data.frame", "Canopy") or c("data.frame", "VolumeSet") object.

...

Further potential arguments passed to shapelist3d.

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.

Details

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.

Value

An object of class c("shapelist3d", "shape3d").

See Also

shapelist3d in the rgl package for a more detailed explanation.

Examples

 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")

chgigot/canis documentation built on May 13, 2019, 3:56 p.m.