Clear the current rgl device or open a new one (if there are no devices or
if open = TRUE).
Additionally assign the middle button to zoom (via setmousemode()) and
the right button to panning (via pan3d()).
Arguments
- open
if
TRUEa new rgl device is opened.- clear
rgl stack(s) to remove, see argument
typeinrgl::clear3d()(used only if there is an active device andopen = FALSE). Defaults to"all", with a new light source added to the scene.- ...
additional arguments, passed to
rgl::open3d()orrgl::clear3d().
Value
Called for its side effect (opens or clears the rgl device, and configures the mouse mode); invisibly returns the current device.
Examples
library(rgl)
# New rgl device
new3d()
shade3d(volcanom, col = "lightgreen")
# Use the right mouse button to panning and the middle button to zoom
# ...
# Clear the current device
new3d()
sshade3d(volcanom, s = volcanom$vb[3, ], meshColor = "facesvertices",
col = terrain.colors(128))
3D plot