Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rgl.open

Low level window interface


Description

3D real-time rendering system.

Usage

rgl.open(useNULL = rgl.useNULL())     # open new device
rgl.close()    # close current device
rgl.cur()      # returns active device ID
rgl.dev.list() # returns all device IDs
rgl.set(which, silent = FALSE) # set device as active
rgl.quit()     # shutdown RGL device system

Arguments

useNULL

whether to open the “null” device

which

device ID

silent

whether to suppress update of window titles

Details

The RGL device design is oriented towards the R device metaphor. If you send scene management instructions, and there's no device open, it will be opened automatically. Opened devices automatically get the current device focus. The focus may be changed by using rgl.set(). rgl.quit() shuts down the RGL subsystem and all open devices, detaches the package including the shared library and additional system libraries.

The rgl.open() function attempts to open a new RGL window. If the "rgl.antialias" option is set, it will be used to select the requested antialiasing. (See open3d for more description of antialiasing and an alternative way to set the value.)

If useNULL is TRUE, RGL will use a “null” device. This device records objects as they are plotted, but displays nothing. It is intended for use with rglwidget and similar functions.

If rgl.open() fails (e.g. because X windows is not running, or its DISPLAY variable is not set properly), then you can retry the initialization by calling rgl.init(). Do not do this when windows have already been successfully opened: they will be orphaned, with no way to remove them other than closing R. In fact, it's probably a good idea not to do this at all: quitting R and restarting it is a better solution.

This package also includes a higher level interface which is described in the r3d help topic. That interface is designed to act more like classic 2D R graphics. We recommend that you avoid mixing rgl.* and *3d calls.

Value

rgl.open, rgl.close and rgl.set are called for their side effects and return no useful value. Similarly rgl.quit is not designed to return useful values; in fact, users shouldn't call it at all!

rgl.cur returns the currently active devices, or 0 if none is active; rgl.dev.list returns a vector of all open devices. Both functions name the items according to the type of device: null for a hidden null device, wgl for a Windows device, and glX for an X windows device.

See Also


rgl

3D Visualization Using OpenGL

v0.106.8
GPL
Authors
Duncan Murdoch [aut, cre], Daniel Adler [aut], Oleg Nenadic [ctb], Simon Urbanek [ctb], Ming Chen [ctb], Albrecht Gebhardt [ctb], Ben Bolker [ctb], Gabor Csardi [ctb], Adam Strzelecki [ctb], Alexander Senger [ctb], The R Core Team [ctb, cph], Dirk Eddelbuettel [ctb], The authors of Shiny [cph], The authors of knitr [cph], Jeroen Ooms [ctb], Yohann Demont [ctb], Joshua Ulrich [ctb], Xavier Fernandez i Marin [ctb], George Helffrich [ctb], Ivan Krylov [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.