scene {rgl} | R Documentation |
Clear shapes, lights, bbox
clear3d( type = c("shapes", "bboxdeco") ) rgl.clear( type = "shapes" ) pop3d( ... ) rgl.pop( type = "shapes", id = 0 ) rgl.ids( type = "shapes" )
type |
Select subtype(s):
|
id |
vector of ID numbers of items to remove |
... |
generic arguments passed through to RGL-specific (or other) functions |
RGL holds two stacks. One is for shapes and the other is for lights.
clear3d
and rgl.clear
clear the specified stack, or restore
the defaults for the bounding box (not visible) or viewpoint. By default
with id=0
rgl.pop
removes
the top-most (last added) node on the shape stack. The id
argument
may be used to specify arbitrary item(s) to remove from the specified stack.
rgl.ids
returns a dataframe containing the IDs in the currently active
rgl window, along with an indicator of their type.
For convenience, type="shapes"
and
id=1
signifies the bounding box.
Note that clearing the light stack leaves the scene in darkness; it should normally
be followed by a call to rgl.light
or light3d
.
x <- rnorm(100) y <- rnorm(100) z <- rnorm(100) p <- plot3d(x, y, z, type='s') rgl.ids() lines3d(x, y, z) rgl.ids() if (interactive()) { readline("Hit enter to change spheres") rgl.pop(id = p[c("data", "box.lines")]) spheres3d(x, y, z, col="red", radius=1/5) box3d() }