Set up the bounding box decoration.

rgl.bbox(
xat = NULL, xlab = NULL, xunit = 0, xlen = 5,
yat = NULL, ylab = NULL, yunit = 0, ylen = 5,
zat = NULL, zlab = NULL, zunit = 0, zlen = 5,
marklen = 15.0, marklen.rel = TRUE, expand = 1,
draw_front = FALSE, ...)
bbox3d(xat = NULL, yat = NULL, zat = NULL,
xunit = "pretty", yunit = "pretty", zunit = "pretty",
expand = 1.03,
draw_front = FALSE, ...)

Arguments

xat, yat, zat

vector specifying the tickmark positions

xlab, ylab, zlab

character vector specifying the tickmark labeling

xunit, yunit, zunit

value specifying the tick mark base for uniform tick mark layout

xlen, ylen, zlen

value specifying the number of tickmarks

marklen

value specifying the length of the tickmarks

marklen.rel

logical, if TRUE tick mark length is calculated using 1/marklen * axis length, otherwise tick mark length is marklen in coordinate space

expand

value specifying how much to expand the bounding box around the data

draw_front

draw the front faces of the bounding box

...

Material properties (or other rgl.bbox parameters in the case of bbox3d). See rgl.material for details.

Details

Four different types of tick mark layouts are possible. This description applies to the X axis; other axes are similar: If xat is not NULL, the ticks are set up at custom positions. If xunit is numeric but not zero, it defines the tick mark base. If it is "pretty" (the default in bbox3d), ticks are set at pretty locations. If xlen is not zero, it specifies the number of ticks (a suggestion if xunit is "pretty").

The first color specifies the bounding box, while the second one specifies the tick mark and font color.

bbox3d defaults to pretty locations for the axis labels and a slightly larger box, whereas rgl.bbox covers the exact range.

axes3d offers more flexibility in the specification of the axes, but they are static, unlike those drawn by rgl.bbox and bbox3d.

Value

This function is called for the side effect of setting the bounding box decoration. A shape ID is returned to allow pop3d to delete it.

rgl.material, axes3d

Examples

  rgl.open()
rgl.points(rnorm(100), rnorm(100), rnorm(100))
rgl.bbox(color = c("#333377", "white"), emission = "#333377",
specular = "#3333FF", shininess = 5, alpha = 0.8 )

{"x":{"material":{"color":"#000000","alpha":1,"lit":true,"ambient":"#000000","specular":"#FFFFFF","emission":"#000000","shininess":50,"smooth":true,"front":"filled","back":"filled","size":3,"lwd":1,"fog":true,"point_antialias":false,"line_antialias":false,"texture":null,"textype":"rgb","texmipmap":false,"texminfilter":"linear","texmagfilter":"linear","texenvmap":false,"depth_mask":true,"depth_test":"less","isTransparent":false,"polygon_offset":[0,0],"margin":"","floating":false,"tag":""},"rootSubscene":273,"objects":{"279":{"id":279,"type":"points","material":{"lit":false},"vertices":"0","colors":"1","centers":"2","ignoreExtent":false,"flags":34816},"277":{"id":277,"type":"light","vertices":[[0,0,1]],"colors":[[1,1,1,1],[1,1,1,1],[1,1,1,1]],"viewpoint":true,"finite":false},"276":{"id":276,"type":"background","material":{},"colors":"3","centers":"4","sphere":false,"fogtype":"none","fogscale":1,"flags":32768},"278":{"id":278,"type":"background","material":{"lit":false,"back":"lines"},"colors":"5","centers":"6","sphere":false,"fogtype":"none","fogscale":1,"flags":32768},"280":{"id":280,"type":"bboxdeco","material":{"alpha":[0.800000011920929,0.800000011920929],"specular":"#3333FF","emission":"#333377","shininess":5,"isTransparent":true},"vertices":"7","colors":"8","axes":{"mode":["pretty","pretty","pretty"],"step":[1,1,1],"nticks":[5,5,5],"marklen":[15,15,15],"expand":[1.02999997138977,1.02999997138977,1.02999997138977]},"draw_front":false,"flags":32801},"273":{"id":273,"type":"subscene","par3d":{"antialias":8,"FOV":30,"ignoreExtent":false,"listeners":273,"mouseMode":{"none":"none","left":"trackball","right":"zoom","middle":"fov","wheel":"pull"},"observer":[0,0,23.0677947998047],"modelMatrix":[[1,0,0,-0.209254026412964],[0,0.342020153999329,0.939692616462708,0.693463742733002],[0,-0.939692616462708,0.342020153999329,-22.8587398529053],[0,0,0,1]],"projMatrix":[[3.73205065727234,0,0,0],[0,3.73205065727234,0,0],[0,0,-3.86370325088501,-83.1567306518555],[0,0,-1,0]],"skipRedraw":false,"userMatrix":[[1,0,0,0],[0,0.342020143325668,0.939692620785909,0],[0,-0.939692620785909,0.342020143325668,0],[0,0,0,1]],"userProjection":[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],"scale":[1,1,1],"viewport":{"x":0,"y":0,"width":1,"height":1},"zoom":1,"bbox":[-2.22566342353821,2.64417147636414,-2.62243390083313,2.54097104072571,-3.82519268989563,2.37890529632568],"windowRect":[42,84,298,340],"family":"sans","font":1,"cex":1,"useFreeType":true,"fontname":"/System/Library/Fonts/Supplemental/Arial.ttf","maxClipPlanes":6,"glVersion":2.1,"activeSubscene":0},"embeddings":{"viewport":"replace","projection":"replace","model":"replace","mouse":"replace"},"objects":[278,280,279,277],"subscenes":[],"flags":35105}},"crosstalk":{"key":[],"group":[],"id":[],"options":[]},"width":480,"height":480,"buffer":{"accessors":[{"bufferView":0,"componentType":5126,"count":100,"type":"VEC3"},{"bufferView":1,"componentType":5121,"count":1,"type":"VEC4"},{"bufferView":2,"componentType":5126,"count":100,"type":"VEC3"},{"bufferView":3,"componentType":5126,"count":1,"type":"VEC4"},{"bufferView":4,"componentType":5121,"count":1,"type":"VEC3"},{"bufferView":5,"componentType":5121,"count":1,"type":"VEC4"},{"bufferView":6,"componentType":5121,"count":1,"type":"VEC3"},{"bufferView":7,"componentType":5126,"count":16,"type":"VEC3"},{"bufferView":8,"componentType":5126,"count":2,"type":"VEC4"}],"bufferViews":[{"buffer":0,"byteLength":1200,"byteOffset":0},{"buffer":0,"byteLength":4,"byteOffset":1200},{"buffer":0,"byteLength":1200,"byteOffset":1204},{"buffer":0,"byteLength":16,"byteOffset":2404},{"buffer":0,"byteLength":3,"byteOffset":2420},{"buffer":0,"byteLength":4,"byteOffset":2423},{"buffer":0,"byteLength":3,"byteOffset":2427},{"buffer":0,"byteLength":192,"byteOffset":2432},{"buffer":0,"byteLength":32,"byteOffset":2624}],"buffers":[{"byteLength":2656,"bytes":"3VDaP3bFiL/wzmw/qAedPtt9tj/M33e/5GpvvoSLmT/5tVM/OYcSv+bJ1r8LyzG/+BKYP1IW\n6j+cKYS+jVcMP3MDCb9XbwK/cNjCv9vtVb/Td9G+squDPxUrQr/18CnAmQhKPxd9qb809IA+\nX4+uPgHZST8kem6/aEe/v1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AAADAfwAAwH8AAIA/AADAfwAAwH8AAABA\nAADAfwAAwH8AAMB/AAAAwAAAwH8AAMB/AACAvwAAwH8AAMB/AAAAAAAAwH8AAMB/AACAPwAA\nwH8AAMB/AAAAQAAAwH8AAMB/AADAfwAAQMAAAMB/AADAfwAAAMAAAMB/AADAfwAAgL8AAMB/\nAADAfwAAAAAAAMB/AADAfwAAgD8AAMB/AADAfwAAAEDNzEw+zcxMPu/u7j7NzEw/AAAAAAAA\nAAAAAAAAzcxMPw=="}]},"context":{"shiny":false,"rmarkdown":null},"players":[],"webGLoptions":{"preserveDrawingBuffer":true}},"evals":[],"jsHooks":[]}