rgl

rgl is a 3D visualization system based on OpenGL. It provides a medium to high level interface for use in R, currently modelled on classic R graphics, with extensions to allow for interaction.

https://github.com/dmurdoch/rgl

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 14 committers (14.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (19.6%) to scientific vocabulary

Keywords

graphics opengl r rgl webgl

Keywords from Contributors

tidy-data rmarkdown package-creation data-manipulation
Last synced: 6 months ago · JSON representation

Repository

rgl is a 3D visualization system based on OpenGL. It provides a medium to high level interface for use in R, currently modelled on classic R graphics, with extensions to allow for interaction.

Basic Info
Statistics
  • Stars: 97
  • Watchers: 3
  • Forks: 21
  • Open Issues: 16
  • Releases: 16
Topics
graphics opengl r rgl webgl
Created about 5 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Support

README.Rmd

---
output: github_document
---



RGL - 3D visualization device system for R using OpenGL
=======================================================

```{r include=FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README"
)

suppressPackageStartupMessages(library(rgl))

options(rgl.useNULL = TRUE)

if (!requireNamespace("rmarkdown", quietly = TRUE)) {
  warning(call. = FALSE, "These vignettes assume rmarkdown.  This was not found.")
  knitr::knit_exit()
}
setupKnitr(autoprint = TRUE)
```

```{r polyhedra, fig.height=1.5, echo = FALSE}
hcl.colors <- rgl:::hcl.colors  # might be cm.colors on old R
col <- hcl.colors(5)
mfrow3d(1,5)
shade3d(icosahedron3d(), col = col[1])
next3d()
shade3d(dodecahedron3d(), col = col[2])
next3d()
shade3d(octahedron3d(), col = col[3])
next3d()
shade3d(cube3d(), col = col[4])
next3d()
shade3d(tetrahedron3d(), col = col[5])
```


[![CRAN status](https://www.r-pkg.org/badges/version/rgl)](https://CRAN.R-project.org/package=rgl)
[![R-CMD-check](https://github.com/dmurdoch/rgl/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dmurdoch/rgl/actions/workflows/R-CMD-check.yaml)


INTRODUCTION
------------
The RGL package is a visualization device system for R, using 
OpenGL or WebGL as the rendering backend. An OpenGL rgl device 
at its core is a real-time 3D engine written in C++. It provides an 
interactive viewpoint navigation facility (mouse + wheel support)
and an R programming interface.  WebGL, on the other hand, is
rendered in a web browser; rgl produces the input file, and the 
browser shows the images.

WEBSITE
-------

A `pkgdown` website is here:

 https://dmurdoch.github.io/rgl/
 
The unreleased development version website is here:

 https://dmurdoch.github.io/rgl/dev/
 
See [this vignette](https://dmurdoch.github.io/rgl/dev/articles/pkgdown.html)
for details on producing your own `pkgdown` website that
includes `rgl` graphics.

The currently active development site is here:

 https://github.com/dmurdoch/rgl

INSTALLATION
------------

Most users will want to install the latest CRAN release.
For Windows, macOS and some Linux platforms, installation can 
be easy, as CRAN distributes binary versions:

```
# Install latest release from CRAN
install.packages("rgl")
```

To install the latest development version from Github, 
you'll need to do a source install.  Those aren't easy!
Try

```
# Install development version from Github
remotes::install_github("dmurdoch/rgl")
```

If that fails, read the instructions below.

Currently installs are tested on older R versions 
back to R 3.5.x, but this version of `rgl` may work
back as far as R 3.3.0.


LICENSE
-------
The software is released under the GNU Public License. 
See [COPYING](./COPYING) for details.  


FEATURES
--------
- portable R package using OpenGL (if available) on macOS, Win32 and X11
- can produce 3D graphics in web pages using WebGL
- R programming interface 
- interactive viewpoint navigation
- automatic data focus
- geometry primitives: 
  points, lines, triangles, quads, texts, point sprites
- high-level geometry:
  surface, spheres
- up to 8 light sources
- alpha-blending (transparency)
- side-dependent fill-mode rendering (dots, wired and filled)
- texture-mapping with mipmapping and environment mapping support
- environmental effects:
  fogging, background sphere
- bounding box with axis ticks marks
- undo operation:
  shapes and light-sources are managed on type stacks,
  where the top-most objects can be popped, or any item specified by
  an identifier can be removed


PLATFORMS
---------
macOS
Windows 7/10
Unix-derivatives


BUILD TOOLS
-----------
R recommended tools (gcc toolchain)
On Windows, Rtools40 (or earlier versions for pre-R-4.0.0)

REQUIREMENTS
------------
**For OpenGL display:**

Windowing System (unix/x11 or Windows)  
OpenGL Library  
OpenGL Utility Library (GLU)  

**For WebGL display:**

A browser with WebGL enabled.  See https://get.webgl.org.

Installing OpenGL support
-----------------------

**Debian and variants including Ubuntu:**

    aptitude install libgl1-mesa-dev libglu1-mesa-dev

**Fedora:**

    yum install mesa-libGL-devel mesa-libGLU-devel libpng-devel

**macOS:**  

Install XQuartz.  
`rgl` should work with XQuartz 2.7.11 or newer, but it will probably
need rebuilding if the XQuartz version changes. XQuartz normally needs
re-installation whenever the macOS version changes.

**Windows:**  

Windows normally includes OpenGL support, but to get the appropriate
include files etc., you will need the appropriate version of
[Rtools](https://cran.r-project.org/bin/windows/Rtools/) matched to your
R version.

Options
-------

The **libpng** library version 1.2.9 or newer is needed for pixmap import/export support.

The **freetype** library is needed for resizable 
anti-aliased fonts.  


BUILDING/INSTALLING
-------------------

Binary builds of `rgl` are available for some platforms on CRAN.

For source builds, install the prerequisites as described
above, download
the tarball and at the command line run

    R CMD INSTALL rgl_`r packageVersion("rgl")`.tar.gz

(with the appropriate version of the tarball).  The build
uses an `autoconf` configure script; to see the options, 
expand the tarball and run `./configure --help`.

Alternatively,
in R run

    install.packages("rgl")

to install from CRAN, or

    remotes::install_github("dmurdoch/rgl")
    
to install the development version from Github.

### BUILDING ON MACOS

To build on MacOS using one of the ARM64 chips (currently M1, M2 or
M3), follow the instructions on https://mac.r-project.org/tools/
to install the tools and libraries into `/opt/R/arm64`.  It is
important that `/opt/R/arm64/bin` appear in your
PATH before `/usr/local/bin` if the latter directory has been used
for x86_64 installs.  If you don't do this, or have some other 
error in setting things up, you'll get a warning during 
`rgl` installation saying that some configure test failed, and `rgl`
will be installed without OpenGL support.

Some versions of RStudio (including 2024.04.2+764) have a bug that 
modifies your PATH on startup and again after every package
installation, putting `/usr/local/bin` at the head of the PATH.
If you are building `rgl` in such a system you need to remove
files from `/usr/local/bin` if there's a file with the same name in 
`/opt/R/arm64/bin`.  Hopefully this bug will be fixed soon!

### BUILDING WITHOUT OPENGL
  
As of version 0.104.1, it is possible to build the package without
OpenGL support on Unix-alikes (including macOS) with the configure option
    --disable-opengl 
For example,
  
    R CMD INSTALL --configure-args="--disable-opengl" rgl_`r packageVersion("rgl")`.tar.gz 
  
  On Windows, OpenGL support cannot currently be disabled.
  
  
DOCUMENTATION and DEMOS: 
------------------------

```
library(rgl)
browseVignettes("rgl")
demo(rgl)
```

CREDITS
-------
Daniel Adler   
Duncan Murdoch   
Oleg Nenadic   
Simon Urbanek   
Ming Chen   
Albrecht Gebhardt   
Ben Bolker   
Gabor Csardi   
Adam Strzelecki   
Alexander Senger   
The R Core Team for some code from R.  
Dirk Eddelbuettel   
The authors of Shiny for their private RNG code.  
The authors of `knitr` for their graphics inclusion code.
Jeroen Ooms for `Rtools40` and `FreeType` help.  
Yohann Demont for Shiny code, suggestions, and testing.  
Joshua Ulrich for a lot of help with the Github migration.
Xavier Fernandez i Marin for help debugging the build.  
George Helffrich for draping code.  
Ivan Krylov for window_group code in X11.  
Michael Sumner for as.mesh3d.default enhancement.  
Tomas Kalibera for `winutf8` and other help.  
David Hugh-Jones for documentation improvements.  
Trevor Davis for a `snapshot3d` patch.  
Mike Stein for pointer-handling code.  
Jonathon Love for the `uname` patch.  
Volodymyr Agafonkin and many others for the `earcut`
triangulation code.  

Owner

  • Login: dmurdoch
  • Kind: user

GitHub Events

Total
  • Create event: 31
  • Issues event: 36
  • Release event: 6
  • Watch event: 10
  • Delete event: 26
  • Issue comment event: 75
  • Push event: 144
  • Pull request event: 59
  • Fork event: 1
Last Year
  • Create event: 31
  • Issues event: 36
  • Release event: 6
  • Watch event: 10
  • Delete event: 26
  • Issue comment event: 75
  • Push event: 144
  • Pull request event: 59
  • Fork event: 1

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 2,231
  • Total Committers: 14
  • Avg Commits per committer: 159.357
  • Development Distribution Score (DDS): 0.13
Past Year
  • Commits: 63
  • Committers: 2
  • Avg Commits per committer: 31.5
  • Development Distribution Score (DDS): 0.048
Top Committers
Name Email Commits
Duncan Murdoch m****n@g****m 1,941
Daniel Adler d****r@d****g 252
Ben Bolker b****r@g****m 17
David Hugh-Jones d****s@g****m 6
(no author) (****) 4
Jonathon Love j****n@t****c 3
Trevor L Davis t****s@g****m 1
Tomas Kalibera t****a@g****m 1
SugarRayLua 7****a 1
Michael Sumner m****r@g****m 1
Michael Chirico m****4@g****m 1
L Laniewski-Wollk l****i@m****l 1
Jeff Hanson j****n@u****u 1
DJM g****n@m****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 90
  • Total pull requests: 148
  • Average time to close issues: 3 months
  • Average time to close pull requests: 1 day
  • Total issue authors: 44
  • Total pull request authors: 6
  • Average comments per issue: 3.29
  • Average comments per pull request: 0.14
  • Merged pull requests: 133
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 20
  • Pull requests: 52
  • Average time to close issues: 9 days
  • Average time to close pull requests: about 7 hours
  • Issue authors: 13
  • Pull request authors: 2
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.17
  • Merged pull requests: 44
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • dmurdoch (28)
  • stla (9)
  • SaitouToshihide (3)
  • barracuda156 (3)
  • discoleo (3)
  • tylermorganwall (2)
  • uwemenzel (2)
  • SugarRayLua (2)
  • MikeImbar (2)
  • csaybar (1)
  • const-ae (1)
  • AnatolyKerensky (1)
  • R-kicker (1)
  • cfholbert (1)
  • David-R-bird (1)
Pull Request Authors
  • dmurdoch (154)
  • aidanmorales (5)
  • MichaelChirico (5)
  • jonathon-love (2)
  • kalibera (2)
  • llaniewski (1)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 62,495 last-month
  • Total docker downloads: 1,275,056
  • Total dependent packages: 401
  • Total dependent repositories: 1,218
  • Total versions: 106
  • Total maintainers: 1
cran.r-project.org: rgl

3D Visualization Using OpenGL

  • Versions: 106
  • Dependent Packages: 401
  • Dependent Repositories: 1,218
  • Downloads: 62,495 Last month
  • Docker Downloads: 1,275,056
Rankings
Downloads: 0.1%
Dependent packages count: 0.3%
Dependent repos count: 0.4%
Forks count: 4.2%
Average: 4.5%
Stargazers count: 4.6%
Docker downloads count: 17.3%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
.github/workflows/R-CMD-fullcheck.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
.github/workflows/R-CMD-nosoft-check.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action 4.1.4 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • R >= 3.3.0 depends
  • waldo * enhances
  • R6 * imports
  • base64enc * imports
  • grDevices * imports
  • graphics * imports
  • htmltools * imports
  • htmlwidgets >= 1.6.0 imports
  • jsonlite >= 0.9.20 imports
  • knitr >= 1.33 imports
  • magrittr * imports
  • mime * imports
  • stats * imports
  • utils * imports
  • MASS * suggests
  • V8 * suggests
  • alphashape3d * suggests
  • chromote * suggests
  • crosstalk * suggests
  • deldir >= 1.0 suggests
  • downlit >= 0.4.0 suggests
  • extrafont * suggests
  • interp * suggests
  • js >= 1.2 suggests
  • lattice * suggests
  • magick * suggests
  • manipulateWidget >= 0.9.0 suggests
  • markdown * suggests
  • misc3d * suggests
  • orientlib * suggests
  • pkgdown >= 2.0.0 suggests
  • plotrix >= 3.7 suggests
  • rmarkdown >= 2.16 suggests
  • shiny * suggests
  • tcltk * suggests
  • testthat * suggests
  • tripack * suggests
  • webshot2 >= 0.1.0 suggests
.github/workflows/R-CMD-oldwincheck.yml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/rhub.yaml actions
  • actions/checkout v3 composite
  • r-hub/rhub2/actions/rhub-check v1 composite
  • r-hub/rhub2/actions/rhub-setup v1 composite
  • r-hub/rhub2/actions/rhub-setup-r v1 composite