Class for creating an opengl scene with rgl.
Class for creating an opengl scene with rgl.
default_materialdefault material
width, heightdimensions of rgl window
polygon_offset, polygon_offset_deltacurrent polygon offset, and the delta to adjust the offset by every time an element is drawn
width, heightdimensions of rgl window
polygon_offset, polygon_offset_deltacurrent polygon offset, and the delta to adjust the offset by every time an element is drawn
new()initialise
RGLDoc$new( fov = 30, width = 800, height = 600, zscale = 1, view = c("front", "flat"), view_angle = 0, view_flat_angle = -45, zoom = 0.8, view3d_args = NULL, light = list(theta = 0, phi = 0), background = list(color = "white"), default_material = standard_material, polygon_offset_delta = 0.03, ... )
fovfield of view. default: 0 isometric view. Other good values are 30 and 45.
width, heightdimensions of viewing window. default 800x600
zscalescale factor applied to z axis. default 1.
viewOne of 'front', 'flat'. This will be ignored if view3d_args
is set.
view_anglerotation angle of view in degrees. Only used if view is
'front' or 'flat'. Default: 0
view_flat_angleangle to tip view when view is 'flat'.
zoomzoom level. default 0.800. Larger values make the plot appear further from the screen.
view3d_argsfull viewpoint specification as a list of arguments to
rgl::view3d(). Default: NULL
lightlist of arguments to rgl.light() to define the
light for this scene.
backgroundlist of arguments to rgl.bg() to define the
background for these scene
default_materialdefault material for objects
polygon_offset_deltaincremental change in polygon_offset after
every element is rendered. Adjust this value to try and
minimise issues with z-fighting of overlapping elements.
...other arguments passed to rgl::open3d()
Add a circle
circle()RGLDoc$circle( x, y, z, r, colour, color = colour, alpha = 1, circle_segments = 30 )
x, y, zcoords
rradius
colour, colorcolour
alphaalpha
circle_segmentsnumber of segments to render for a circle Add an arbitrary call to this document
add_call()RGLDoc$add_call(cc, default_args = standard_material)
ccstandard R call object
default_argsdefault args Add a sphere
sphere()RGLDoc$sphere(x, y, z, r, colour, color = colour, alpha = 1)
x, y, zcoords
rradius
colour, colorcolour
alphaalpha Add a point
point()RGLDoc$point(x, y, z, r, colour, color = colour, alpha = 1)
x, y, zcoords
rradius
colour, colorcolour
alphaalpha Add a rect
rect()RGLDoc$rect( x1, y1, x2, y2, z, colour, fill, lwd = 3, color = colour, alpha = 1 )
x1, y1, x2, y2, zcoords
colour, color, fillcolour
lwdline width i.e. size
alphaalpha Add a line
line()RGLDoc$line(x1, y1, x2, y2, z, colour, lwd = 3, color = colour)
x1, y1, x2, y2, zcoords
colour, colorcolour
lwdline width i.e. size Add a polyline
polyline()RGLDoc$polyline(xs, ys, z, colour, lwd = 3, color = colour)
xs, ys, zcoords
colour, colorcolour
lwdline width i.e. size Add a polygon
polygon_old()RGLDoc$polygon_old(xs, ys, z = 0, colour, fill, alpha = 1, lwd = 3)
xs, ys, zcoords
colour, fillcolour
alphaalpha
lwdline width i.e. size Add a polygon
polygon()RGLDoc$polygon(xs, ys, z = 0, colour, fill, alpha = 1, lwd = 3)
xs, ys, zcoords
colour, fillcolour
alphaalpha
lwdline width i.e. size Add a path
path()RGLDoc$path(df, colour, fill, alpha = 1, lwd = 3)
dfpolygon specification
colour, fillcolour
alphaalpha
lwdline width i.e. size Add text
text()RGLDoc$text(text, x, y, z = 0, colour, cex = 1)
texttext to write
x, y, zcoords
colour, colorcolour
cexcharacter expansion values Render an image onto a quad
image_as_quad()RGLDoc$image_as_quad( png_filename, x, y, z, width, height, alpha = 1, angle = 0, option = 0 )
png_filenamefilename of PNG to add to image
x, ydisplay position
zheight
width, heightdisplay width and height
alphaoverall alpha
anglerotation angle of quad around the z axis
optiongeneric option to control rendering Save as PNG or WebGL based upon suffix
save()RGLDoc$save(filename)
filenamefilename
clone()The objects of this class are cloneable with this method.
RGLDoc$clone(deep = FALSE)
deepWhether to make a deep clone.