Questions tagged [rgl]

`rgl` is a 3D visualization device system for R, using OpenGL as the rendering backend.

The rgl package is a 3D visualization device system for R based on OpenGL. An 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.

Features:

  • Cross-platform (Mac OS X, Win32, Unix/X11)
  • R programming interface
  • Interactive viewpoint navigation
  • Automatic data focus Geometry primitives: points, lines, triangles, quads, texts, spheres, 3D sprites, particles, terrain
  • Up to eight light sources
  • Alpha-blending (transparency)
  • Side-dependant rendering
  • Texture-mapping with mipmap support
  • Environmental effects: fogging, background sphere
  • Bounding box with axis ticks marks
  • Undo operation

Resources:

558 questions
8
votes
2 answers

Including a 3D interactive figure in html and static in word/pdf using knitr and rgl

Following this question (including a interactive 3D figure with knitr) and this example by Yihui (https://dl.dropboxusercontent.com/u/15335397/misc/webgl-rmd.html), I can include a 3D interactive figure in html output using knitr and Rmarkdown. But…
Bangyou
  • 9,462
  • 16
  • 62
  • 94
8
votes
1 answer

fixing interpolation over volatility surface graph in R programming

This script below pulls yahoo data via a function in quantmod, then massages the data around to forumalate a 3D graph with RGL library, attached is a ggplot to show the data i'm trying to create a surface with in separate line geoms . the issue is…
cdcaveman
  • 175
  • 1
  • 14
8
votes
4 answers

3D equivalent of the curve function in R?

The curve function in R provides a simple way to plot a function. For example, this will plot a straight line f1 <- function(x) x curve(f1, from=-1, to=1) Is there an equivalent function in R which takes a function with two argument (e.g., x and y)…
Jeromy Anglim
  • 33,939
  • 30
  • 115
  • 173
7
votes
0 answers

How to install the rgl package in macOS Big Sur

I have been trying to install the rgl package in my macOS Big Sur, but I have failed each time. I have downloaded R from the CRAN website, and have also installed Xquartz. After rebooting the computer, I tried to install the rgl package from the R…
Souvik Roy
  • 71
  • 3
7
votes
2 answers

Package rgl in R not loading in Mac OS

I installed the rgl package (0.104.16) in R (3.6.3), but it does not load. I don't get any errors. It just never ends loading. I tried reinstalling R and RStudio and also Xquartz. Nothing is working. I have Mac OS Catalina version 10.15.7. Any help…
Nolozz
  • 71
  • 1
  • 1
  • 3
7
votes
6 answers

How to increase smoothness of spheres3d in rgl

When I use rgl::spheres3d(), the rendered spheres have clunky facetted edges. spheres = data.frame(x = c(1,2,3), y = c(1,3,1), color = c("#992222" , "#222299", "#229922")) open3d() spheres3d(spheres$x, spheres$y, radius = 1,…
dww
  • 30,425
  • 5
  • 68
  • 111
7
votes
2 answers

Obtain spline surface on R

How do I generate a b-spline surface, let's say: x=attitude$rating y=attitude$complaints z=attitude$privileges would be x and y for the spline basis. z is the set of control points.
user3083324
  • 585
  • 8
  • 23
6
votes
2 answers

Help in using rgl package

I installed rgl package with the option --disable-libpng. I tried generating a 3d scatter plot and it crashes. Please help me in resolving this This is the code i am running library(rgl) open3d() x <- sort(rnorm(1000)) y <- rnorm(1000) z <-…
SAN
  • 2,219
  • 4
  • 26
  • 32
6
votes
2 answers

Side-by-side rgl plots with R Markdown

I am trying to get two 3D scatter plots, drawn with the rgl package, side-by-side in an R Markdown document. For example: mfrow3d(nr = 1, nc = 2, sharedMouse = TRUE) plot3d(mtcars[, 1:3], type = "s") plot3d(mtcars[, 4:6], type =…
Jandre Marais
  • 318
  • 2
  • 9
6
votes
2 answers

replicating an rgl viewpoint in lattice

It would be convenient to interactively select a decent viewpoint using rgl and then adopt the same orientation in a lattice 3d-plot. For example, given the following plot using a non-informative viewpoint. library(lattice) wireframe(volcano, screen…
Mark Heckmann
  • 10,943
  • 4
  • 56
  • 88
6
votes
1 answer

error: installation of package ‘rgl’ had non-zero exit status

I would like to use plot 3D so I was trying to download rgl but whenever I am trying to install this, I am getting this error in rgl package installation. So can you please suggest me something. install.packages("rgl", dependencies=TRUE) …
meghavarshney
  • 89
  • 1
  • 1
  • 8
6
votes
1 answer

'You must enable Javascript to view this page properly' error in shiny (R)

I was trying to use rgl plot in shiny,but somehow it is throwing error: 'You must enable Javascript to view this page properly'. Javascript is already enabled. I used 'shinyRGL' library in R to display its output,but failed. Kindly help!
6
votes
2 answers

Shiny RGL Plot3D: Keep Plot View Orientation On Replot

Whenever I do a re-plot on a RGL plot3D it causes the view orientation of the plot to be reset to it's default. Does anyone know how to save these settings so that I can reapply them after a plot is redrawn. I tried this: # save settings pp <-…
bcorso
  • 45,608
  • 10
  • 63
  • 75
6
votes
1 answer

How to build a Weighted Graph with Ruby's RGL or GRATR to perform Dijkstra's algorithm?

I would like to see an example of a Dijkastra search algorithm for a graph built using Ruby's RGL (http://rgl.rubyforge.org/) or GRATR (http://rubyforge.org/projects/gratr/). I know GRATR has Dijkastra support but I'm not really sure how to go…
Andres
  • 485
  • 1
  • 4
  • 10
6
votes
0 answers

Error running the packages "rgl' and "geomorph" on R on Mac

I am trying to run the package "geomorph" on R. I know I need to install the packages "rgl' and "geomorph" and the following (respectively) to do so: install.packages("rgl") Then I: require("rgl") But for both the following error appeared: >…
Sam P
  • 61
  • 2
1 2
3
37 38