Saves the current scene to a variable, and displays such variables.
This function saves a large part of the RGL state associated with the current window to a variable.
scene3d() ## S3 method for class 'rglscene': plot3d(x, add = FALSE, ...) ## S3 method for class 'rglobject': plot3d(x, ...) ## S3 method for class 'rglscene': print(x, ...) ## S3 method for class 'rglobject': print(x, ...)
- An object of class
- Whether to open a new window, or add to the existing one.
- Additional parameters, currently ignored.
In most cases, calling
plot3d on that variable will
duplicate the scene. (There are likely to be small differences, mostly internal, but
some aspects of the scene are not currently available.) If textures are used,
the name of the texture will be saved, rather than the contents of the
Other than saving the code
to recreate a scene, saving the result of
a file will allow it to be reproduced later most accurately. In roughly decreasing order of fidelity,
write the scene to a file in formats readable by other software.
scene3dfunction returns an object of class
"rglscene". This is a list with some or all of the components
par3d The results returned from a
material The results returned from a
bg A list containing some of the properties of the scene background. bbox A list containing some of the properties of the scene bounding box decoration. objects A list containing the RGL lights and objects in the scene.
- The objects in the
objectscomponent are of class
"rglobject". They are lists containing some or all of the components
id The RGL identifier of the object in the original scene. type A character variable identifying the type of object. material Components of the material that differ from the scene material. vertices, normals, etc. Any of the attributes of the object retrievable by
ignoreExtent A logical value indicating whether this object contributes to the bounding box. Currently this may differ from the object in the original scene. objects Sprites may contain other objects; they will be stored here as a list of
- Lights in the scene are stored similarly, mixed into the
plot3dmethods invisibly return a vector of RGL object ids that were plotted. The
open3d() z <- 2 * volcano # Exaggerate the relief x <- 10 * (1:nrow(z)) # 10 meter spacing (S to N) y <- 10 * (1:ncol(z)) # 10 meter spacing (E to W) persp3d(x, y, z, col = "green3", aspect = "iso") s <- scene3d() # Make it bigger s$par3d$windowRect <- 1.5*s$par3d$windowRect # and draw it again plot3d(s)