Description Usage Arguments Details Value
Initializing the rgl system.
1 2 |
initValue |
value for internal use only |
onlyNULL |
only initialize the null (no display) device |
debug |
enable some debugging messages |
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. Note however that some recent MacOS systems do not support OpenGL at all.
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 rgl 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.
Normally the user doesn't call rgl.init
at all: it
is called when the package is loaded. It returns no
useful value.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.