as.rglscene.Rd
These methods convert a "gltf"
object to
a "rglscene"
object, similar to what scene3d
would produce, or a "mesh3d"
object.
# S3 method for gltf
as.rglscene(x, scene = x$scene, nodes = NULL,
useRGLinfo = TRUE, time = NULL, ani = 0, clone = TRUE,
quick = FALSE, add = FALSE, ...)
# S3 method for gltf
as.mesh3d(x, ...)
The "gltf"
object to convert.
Which scene to convert? If NULL
(e.g.
x
doesn't define a default scene), scene 0 will be used.
Which nodes to convert? If NULL
, all
nodes used in the scene will be converted, otherwise only
the listed ones and their children.
"gltf"
objects contain RGL-specific information
in “extra” fields. If useRGLinfo
is TRUE
, we use
that information, otherwise include only what standard glTF viewers would display.
Set the "time" within an animation.
Animation number to use.
Whether to clone the gltf
object. See the Details below.
If TRUE
, plot3d
will work
on the result, but it is not sufficiently complete to use
as the scene in rglwidget
.
If quick = FALSE
, the scene will be plotted
in an existing rgl scene, and both old and new parts will be returned.
as.mesh3d
passes these arguments to as.rglscene
.
These functions need to modify the glTF object, caching
some information to help with the conversion. By default
they do this on a cloned copy of it, and the original is
left unchanged. If the object has already been cloned
this can be skipped by setting clone = FALSE
.
An "rglscene"
object.