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
0
votes
1 answer

How to plot two 3D graphs on the same plot in R

I'm using the plot3d function in the library rgl. Suppose my data looks something like this. x <- c(1,2,3,4,5) y <- c(4,2,1,4,2) z <- c(2,2,4,5,1) x2 <- c(1,5,2,3,4) y2 <- c(2,3,4,1,2) z2 <- c(3,4,2,3,1) plot3d(x, y,…
Adrian
  • 9,229
  • 24
  • 74
  • 132
0
votes
1 answer

Inputting a fixed colour input vector with RGL in R

Is there any way to input a fixed vector of colours to any 3D rgl plots? If so it would be possible to extrude a map tile to a 3D surface based on a raster of the same area. But I'm finding the surface3d function behaves the same as raster::plot…
geotheory
  • 22,624
  • 29
  • 119
  • 196
0
votes
2 answers

How to extract values from a 3D kernel density plot built in R using 'ks' and 'rgl'

I've been using the 'ks' package along with the 'rgl' package to produce 3D kernel density estimates and 3D plots of these. This first part has worked out fine (brief example below). What I can't figure out is if it's possible to extract the values…
dxj
  • 513
  • 4
  • 6
0
votes
1 answer

Saving a plot in 'R' in 'eps' or 'pdf' format via 'rgl.postscript' (why color is changed?)

I am trying to run this code in "R" in order to plot a density function kernel smoothing and then save the plot as an "eps" file: library(ks) library(rgl) kern <- read.table(file.choose(), sep=",") hat <- kde(kern) plot(hat, drawpoints=TRUE, xlab =…
Ali
  • 1
  • 4
0
votes
3 answers

Colour-coded 3D Plot in R

I am new to R, so can someone please help with this? I have a data frame with 4 columns: x,y,z and freq. One row in this frame represents one point in 3D space (x,y,z are x-,y- and z- coordinates respectively) and it's frequency. I want to plot…
Joe Roth
  • 121
  • 2
  • 11
0
votes
0 answers

Adding another line series to lines3 plot

I'm trying to add several line series with different colors to represent each line. I'm using OSX and RStudio 0.97.248 My code: library(rgl) x <-…
serj
  • 508
  • 4
  • 20
0
votes
1 answer

How to make 3D line plot in R (waterfall plot)

I would like to create a waterfall plot in R (XYYY) from my data. So far, I use this code: load("myData.RData") ls() dim(data) ##matrix to xyz coords library(reshape2) newData <- melt(data,…
JLA
  • 1
  • 1
0
votes
1 answer

Discretizing color scheme according to timestamps in r

I have a 3d dataset that I want to plot with rgl such that library(rgl) x = rnorm(2700,0,0.6) y = rnorm(2700,0,0.7) z = rnorm(2700,0,0.5) plot3d(x,y,z) I would like to allocate different colors to different parts of the data and tried…
SnowFrog
  • 1,162
  • 4
  • 19
  • 38
0
votes
1 answer

3d surface plot in R, with z dimension changing over time

I have a dataset with a x-y-z structure. X = age of arrival in the city Y = year of arrival Z = number of current survivors from X/Y combination I have no problem plotting this for any given time using RGL in R. However I would like to introduce a…
-1
votes
1 answer

Cel shading/alpha shape in current visualization

I am playing around with rgl and I have created a 3D rendering of the mouse brain, in which structures can be isolated and coloured separately. The original data is a 3D array containing evenly spaced voxels. Every voxel is coded with a structure…
gdagstn
  • 1
  • 3
-1
votes
1 answer

Creating multiple ellipsoids in rgl to show standard deviation in position values

I have a dataset that contains 13 cameras, each camera location was reconstructed 5 times. I have aggregated the measurements into a mean and standard deviation for each the 6 variables that relate to the position of the camera [X, Y, Z, Omega, Phi,…
c0ba1t
  • 241
  • 2
  • 15
-1
votes
1 answer

toggle buttons to control rgl 3d scatterplot not working

We are working on a meta analysis about lizard niches and convergent evolution, and created a 3d plot with PCA scores, were dots are lizard species from 24 different families. We decided to use our 3d plots as supplementary material for our…
-1
votes
1 answer

.png output for each row of data.frame and making .gif animation

I have some trouble with generating .png from each rows of data frame. Basically, I want to rbind each one of the row of df to coordinate_sys. For each row of df together with coordinate_sys, a coordinate system and one a unit vector "J" should…
Alexander
  • 4,527
  • 5
  • 51
  • 98
-1
votes
1 answer

R - Changing colour of plot from plot3d

I currently trying to use plot3d function from rgl library. open3d() x = usage[,5] y = usage[,6] z = usage$transfer plot3d(x,y,z, type='h') I was wondering if anybody can help me change the colour of the lines such that the positive z will be red…
creampiedonut
  • 327
  • 1
  • 5
  • 17
-1
votes
1 answer

persp3d - main title that doesn't rotate?

Editing to provide more code and a runnable example. If I open a 3D plot using the following code: library(rgl) GainTargets = seq(from=1, to=12, by=1) PredBarTargets = seq(from=3, to=16, by=1) data=structure(c(1176.18, 1379.34, 1280.67, 1149.02,…
LGTrader
  • 2,349
  • 4
  • 23
  • 29
1 2 3
37
38