R Under development (unstable) (2024-09-23 r87189 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(rgl) > library(rgl2gltf) > > set.seed(123) > > xyz <- matrix(rnorm(36, sd=0.5), ncol = 3) > xyz <- scale3d(xyz, 1, 10, 100) > col <- rainbow(12) > > open3d() wgl 1 > plot3d(xyz, type="s") > points3d(xyz+5, col = col) > lines3d(xyz+1, col = col) > segments3d(xyz+2, col = col) > triangles3d(xyz+3, col = col) > quads3d(xyz+4, col = col) > particles3d(xyz+6, col = col, radius = 10) > tetra <- shade3d(tetrahedron3d(), + col = "red") > sprites3d(xyz+7, shapes=tetra, radius = 5) > aspect3d(1,1,1) > s <- scene3d() > # plot3d(s) > g <- as.gltf(s) > s1 <- as.rglscene(g) > plot3d(s1) > s2 <- as.rglscene(g, useRGLinfo = FALSE) > plot3d(s2) > s1 <- scene3d() > w1 <- rglwidget(s1) > s3 <- s2 > w3 <- rglwidget(s3) > w3 > > plot3d(s3) > s4 <- scene3d() > w4 <- rglwidget(s4) > > proc.time() user system elapsed 3.10 0.42 3.53