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

rgl.init

Initializing RGL


Description

Initializing the RGL system.

Usage

rgl.init(initValue = 0, onlyNULL = FALSE, 
         debug = getOption("rgl.debug", FALSE))

Arguments

initValue

value for internal use only

onlyNULL

only initialize the null (no display) device

debug

enable some debugging messages

Details

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.

Currently debug only controls messages printed by the OpenGL library during initialization. In future debug = TRUE may become more verbose.

For display within an OpenGL window in R, RGL requires the OpenGL system to be installed and available. If there is a problem initializing it, you may see the message 'rgl.init' failed, running with 'rgl.useNULL = TRUE'. There are several causes and remedies:

  • On any system, the OpenGL libraries need to be present for RGL to be able to start an OpenGL device.

    • On macOS, you need to install XQuartz. It is available from https://www.xquartz.org.

    • On Linux, you need to install Mesa 3D. One of these commands may work, depending on your system: zypper source-install --build-deps-only Mesa # openSUSE/SLED/SLES yum-builddep mesa # yum Fedora, OpenSuse(?) dnf builddep mesa # dnf Fedora apt-get build-dep mesa # Debian, Ubuntu and related

    • Windows should have OpenGL installed by default.

  • On Unix-alike systems (macOS and Linux, for example), RGL normally uses the GLX system for creating displays. If the graphic is created on a remote machine, it may need to use “Indirect GLX” (IGLX). Due to security concerns, this is often disabled by default. See https://www.x.org/wiki/Development/Security/Advisory-2014-12-09/ for a discussion of the security issues, and https://www.visitusers.org/index.php?title=Re-enabling_INdirect_glx_on_your_X_server for ways to re-enable IGLX.

  • The https://www.virtualgl.org project is intended to be a way to avoid IGLX, by rendering remotely and sending bitmaps to the local machine. It's not a simple install...

  • If you don't need to see RGL displays on screen, you can use the “NULL device”. See rgl.useNULL.

  • If you can't build the rgl package with OpenGL support, you can disable it and use the NULL device. (This may happen automatically during configuration, but you'll get a tested result if you specify it explicitly.) See the instructions in the ‘README’ file in the source tarball.

Value

Normally the user doesn't call rgl.init at all: it is called when the package is loaded. It returns no useful value.


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.