Skip to contents

High level functions

Generic functions for plotting points or surfaces.

plot3d()
3D scatterplot
persp3d()
Surface plots

Methods

persp3d(<function>) plot3d(<function>)
Plot a function of two variables
plot3d(<formula>) persp3d(<formula>)
Methods for formulas
plot3d(<lm>)
Method for plotting simple linear fit

Adding to plots

These add to an existing plot.

Primitive shapes

Other shapes

Axes and “decorations”

axes3d() box3d() title3d() axis3d() mtext3d()
Draw boxes, axes and other text outside the data
bbox3d()
Set up bounding box decoration
decorate3d()
Add decorations to a 3D plot
aspect3d()
Set the aspect ratios of the current plot
bg3d()
Set up background
bgplot3d() legend3d()
Use base graphics for RGL background
show2d()
Draw a 2D plot on a rectangle in a 3D scene
grid3d()
Add a grid to a 3D plot
thigmophobe3d()
Find the direction away from the closest point in a 3d projection
setAxisCallbacks()
User-defined axis labelling callbacks.
rgl.getAxisCallback()
Get user-defined axis labelling callbacks.

Controlling the look of the scene

These functions control the way objects appear.

light3d()
Add light source
material3d() rgl.material.names rgl.material.readonly
Get or set material properties
par3d() rgl.par3d.names rgl.par3d.readonly
Set or query RGL parameters
view3d()
Set up viewpoint
observer3d()
Set the observer location
rglExtrafonts()
Register extra fonts

Complex shapes

These functions construct and display complex shapes.

mesh3d() qmesh3d() tmesh3d()
Construct 3D mesh objects
dot3d() wire3d() shade3d()
Draw 3D mesh objects
cube3d() tetrahedron3d() octahedron3d() icosahedron3d() dodecahedron3d() cuboctahedron3d() oh3d()
Sample 3D mesh objects
cylinder3d()
Create cylindrical or "tube" plots
polygon3d()
Draw a polygon in three dimensions
extrude3d()
Generate extrusion mesh
turn3d()
Create a solid of rotation from a two-dimensional curve
ellipse3d()
Make an ellipsoid
shapelist3d()
Create and plot a list of shapes
as.mesh3d(<ashape3d>)
Convert alpha-shape surface of a cloud of points to RGL mesh object
as.mesh3d()
Convert object to mesh object
as.mesh3d(<rglId>)
Convert object in plot to RGL mesh object
plot3d(<deldir>) persp3d(<deldir>) as.mesh3d(<deldir>)
Plot a Delaunay triangulation
plot3d(<triSht>) persp3d(<triSht>) as.mesh3d(<triSht>)
Plot an interp Delaunay triangulation
as.triangles3d()
Convert an object to triangles
as.tmesh3d()
Convert object to a triangular mesh
mergeVertices()
Merge duplicate vertices in mesh object
getBoundary3d()
Extract the boundary of a mesh

Contouring

These functions are related to showing contour lines.

contourLines3d() filledContour3d()
Draw contours on a surface
clipMesh3d() clipObj3d()
Clip mesh or RGL object to general region

Modifying shapes

addNormals()
Add normal vectors to objects so they render more smoothly
subdivision3d() divide.mesh3d() normalize.mesh3d() deform.mesh3d()
Subdivide a mesh
merge(<mesh3d>)
Merge RGL mesh objects
facing3d() projectDown()
Subset an object to parts facing in a particular direction

Multi-figure layouts

Functions relating to subscenes

Documents and presentations

setupKnitr() hook_rgl() hook_webgl() hook_rglchunk()
Displaying RGL scenes in knitr documents
rgl.snapshot() snapshot3d()
Export screenshot
play3d() movie3d()
Play animation of RGL scene
spin3d()
Create a function to spin a scene at a fixed rate
par3dinterp()
Interpolator for par3d parameters

WebGL displays

subsetControl() propertyControl()
Controls to use with playwidget()
clipplaneControl()
Sets attributes of a clipping plane
ageControl()
Set attributes of vertices based on their age
vertexControl()
Set attributes of vertices
par3dinterpControl()
Control RGL widget like par3dinterp()
playwidget()
Add a widget to play animations
toggleWidget()
An HTML widget to toggle display of elements of a scene
figWidth() figHeight()
Get R Markdown figure dimensions in pixels
rglShared()
Create shared data from an RGL object
rglMouse()
Generate HTML code to select mouse mode
asRow() getWidgetId()
Convenience functions for RGL HTML layouts

Shiny

sceneChange() registerSceneChange()
Make large change to a scene from Shiny
shinyGetPar3d() shinySetPar3d() shinyResetBrush()
Communicate RGL parameters between R and Javascript in Shiny
rglwidgetOutput() renderRglwidget() playwidgetOutput() renderPlaywidget()
Functions for integration of RGL widgets into Shiny app

Import and export

scene3d() plot3d(<rglscene>) plot3d(<rglobject>) print(<rglscene>) print(<rglobject>)
Saves the current scene to a variable, and displays such variables
rglwidget()
An htmlwidget to hold an RGL scene
writeASY()
Write Asymptote code for an RGL scene
writePLY()
Write Stanford PLY format files
writeOBJ() readOBJ()
Read and write Wavefront OBJ format files
readSTL() writeSTL()
Read and write STL (stereolithography) format files
rglToLattice() rglToBase()
Convert RGL userMatrix to lattice or base angles
rgl.postscript()
Export vector graphics
as.rglscene()
Convert an object to an rglscene object.

Miscellaneous utility functions

Opening, closing and changing the display

open3d() close3d() cur3d() rgl.dev.list() set3d() getr3dDefaults() r3dDefaults rgl.quit()
Work with RGL windows
.check3d()
Check for an open RGL window.
rgl.useNULL()
Report default use of null device
rgl.bringtotop()
Assign focus to an RGL window

Manipulating objects in the display

clear3d() pop3d() ids3d()
Scene management
tagged3d()
Find tags on rgl objects.
identify3d()
Identify points in plot
selectpoints3d()
Select points from a scene
select3d() selectionFunction3d()
Select a rectangle in an RGL scene
hover3d()
Display hover info in plot.
rgl.select()
Switch to select mode, and return the mouse position selected
rgl.attrib()
Get information about shapes
rgl.attrib.info() rgl.attrib.count()
Get information about attributes of objects
rgl.pixels()
Extract pixel information from window

Working with coordinates

TCL/TK

tkrgl
The former tkrgl package
tkspin3d()
Create TCL/TK controller for RGL window
tkspinControl()
Create a spin control in a TCL/TK window
tkpar3dsave()
Modal dialog for saving par3d settings

Unclassifiable miscellany

%>% pipe
Imported from magrittr
GramSchmidt()
The Gram-Schmidt algorithm
triangulate()
Triangulate a two-dimensional polygon
rgl.init()
Initializing RGL
rgl.user2window() rgl.window2user() rgl.projection()
Convert between RGL user and window coordinates
rgl.setMouseCallbacks() rgl.getMouseCallbacks() rgl.setWheelCallback() rgl.getWheelCallback()
User callbacks on mouse events
setUserCallbacks()
Set mouse callbacks in R or Javascript code
setUserShaders() getShaders()
Set user-defined shaders for RGL objects, or get shaders.
rglFonts()
Specify FreeType fonts
makeDependency()
Process Javascript for HTML dependency
setGraphicsDelay()
Set a one-time slowdown on opening standard graphics
rglId() lowlevel() highlevel() print(<rglId>)
RGL id values
textureSource()
Retrieve source code used to produce texture file.
in_pkgdown() in_pkgdown_example()
Are we running in pkgdown or a pkgdown example?
facing3d() projectDown()
Subset an object to parts facing in a particular direction
expect_known_scene()
Helper for testthat testing.
all.equal(<mesh3d>) compare_proxy.mesh3d()
Compare mesh3d objects in a meaningful way.
checkDeldir()
Check for a compatible version of deldir
Buffer
R6 Class for binary buffers in glTF files.
gltfTypes
Names of glTF types.
safe.dev.off()
Close graphics device in a safe way.
rgl.incrementID()
Increment ID

General documentation

rgl-package rgl RGL
3D visualization device system
r3d
Generic 3D interface

Obsolete functions