rglwidget(x = scene3d(), width = NULL, height = NULL,
controllers = NULL, snapshot = FALSE,
elementId = NULL, reuse = !interactive(), ...)scene3d function.rglcontroller objects
associated with this scene. See Details below.writeWebGL for details.div
component that will hold the scene.htmlwidgets::createWidget.It should also display in the RStudio viewer.
If reuse = TRUE, a record will be kept of objects in the scene
and they need not be included in the HTML generated for later scenes.
This is normally useful only in
In a rglcontroller objects in the app, taking input from
the user. In order to be sure that the initial value of the user control
is reflected in the scene, you should list all controllers in the
controllers argument. See the sample application in
system.file("shinyDemo", package = "rglwidget") for an example.
If the reuse argument is FALSE (the default in interactive
use), earlier information will be
cleared before drawing the new scene. If TRUE, earlier
data will be re-used in the current scene, so it may be smaller
and faster to load. In both cases information from the current
scene (added to earlier information if reuse=TRUE) will
be saved for possible use in a future scene.
If reuse=NA, the saved information will neither be used
nor updated.
If elementId is NULL and we are not in a Shiny app,
elementId is set to a random value to facilitate re-use
of information.
hook_webgl for an earlier approach to this problem. rglwidgetOutput for Shiny details.save <- getOption("rgl.useNULL")
options(rgl.useNULL=TRUE)
example("plot3d", "rgl")
rglwidget()Run the code above in your browser using DataLab