tylermorganwall / rayshader

R Package for 2D and 3D mapping and data visualization
https://www.rayshader.com/
2.06k stars 214 forks source link

R session gets aborted as soon as I close the rgl window #170

Closed zavud closed 2 years ago

zavud commented 3 years ago

I followed this tutorial to produce 3d map of my satellite imagery. Everything worked fine and I could produce a nice 3d plot of my study area. However, there are few issues:

  1. I cannot drag the 3d map. It is just a static 3d map opened in rgl window.
  2. As soon as I close the rgl window I my R session gets aborted and I have to rerun everything.

BTW, I am using the latest version of rayshader installed from github.

The info about the session (after loading the libraries):

> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] scales_1.1.1     raster_3.4-13    sp_1.4-5         rayshader_0.25.2

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6              compiler_4.1.0          later_1.2.0             prettyunits_1.1.1       iterators_1.0.13        tools_4.1.0            
 [7] progress_1.2.2          extrafont_0.17          digest_0.6.27           jsonlite_1.7.2          lifecycle_1.0.0         lattice_0.20-44        
[13] pkgconfig_2.0.3         rlang_0.4.11            foreach_1.5.1           shiny_1.6.0             crosstalk_1.1.1         parallel_4.1.0         
[19] xfun_0.24               fastmap_1.1.0           Rttf2pt1_1.3.8          knitr_1.33              vctrs_0.3.8             htmlwidgets_1.5.3      
[25] hms_1.1.0               manipulateWidget_0.11.0 grid_4.1.0              R6_2.5.0                rgl_0.106.8             extrafontdb_1.0        
[31] magrittr_2.0.1          codetools_0.2-18        promises_1.2.0.1        ellipsis_0.3.2          htmltools_0.5.1.1       mime_0.10              
[37] colorspace_2.0-1        xtable_1.8-6            httpuv_1.6.1            miniUI_0.1.1.1          doParallel_1.0.16       munsell_0.5.0          
[43] crayon_1.4.1

What may be causing this?

tylermorganwall commented 3 years ago

Does it crash when you run a basic rgl example? What happens when you run the following?

library(rgl)
with(iris, plot3d(Sepal.Length, Sepal.Width, Petal.Length, 
                  type="s", col=as.numeric(Species)))
zavud commented 3 years ago

@tylermorganwall, when I run this code everything works fine, and I even can drag the 3d plot which was not the case with my satellite image's 3d plot

tylermorganwall commented 3 years ago

What happens when you try this example?

library(rgl)
filename <- tempfile(fileext = ".png")
png(filename = filename)
plot(rnorm(1000), rnorm(1000))
dev.off()
open3d()
xyz <- cbind(c(0,1,1,0), 0, c(0,0,1,1))
quads3d(xyz, texture = filename, texcoords = xyz[,c(1, 3)]*2, col = "white", specular = "black")

Try installing the latest version of rgl from github and try again. If it still doesn't work, copy and paste the installation output here, it's almost certainly something missing on your system that's affecting rgl (and will likely appear as a warning when the installation script runs)

remotes::install_github("dmurdoch/rgl")
zavud commented 3 years ago

This code runs perfectly fine as well (it is supposed to give me a draggable "plane" holding 4 1d plots, right?). I reinstalled the rgl package (using remotes::install_github("dmurdoch/rgl")) and then tried my 3d satellite imagery code again (after restarting the session). The same problem still exists (static 3d map, session abortion).

The installation output:

> remotes::install_github("dmurdoch/rgl", force = T)
Downloading GitHub repo dmurdoch/rgl@HEAD
√  checking for file 'C:\Users\zavud\AppData\Local\Temp\RtmpIR3ny0\remotes3d40212b142c\dmurdoch-rgl-b055034/DESCRIPTION' ... 
-  preparing 'rgl': (12.2s)
√  checking DESCRIPTION meta-information ... 
-  cleaning src
-  checking for LF line-endings in source and make files and shell scripts (671ms)
-  checking for empty or unneeded directories (404ms)
-  building 'rgl_0.106.23.tar.gz'
   Warning: file 'rgl/cleanup' did not have execute permissions: corrected
   Warning: file 'rgl/configure' did not have execute permissions: corrected

Installing package into ‘C:/Users/zavud/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
* installing *source* package 'rgl' ...
** using staged installation
** libs

*** arch - i386
"C:/PROGRA~1/R/R-41~1.0/bin/i386/Rscript.exe" "../tools/winlibs.R" 2.10.4
sed -e "s^@RGL_NO_OPENGL@^FALSE^" ../R/noOpenGL.R.in > ../R/noOpenGL.R
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c ABCLineSet.cpp -o ABCLineSet.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c BBoxDeco.cpp -o BBoxDeco.o
BBoxDeco.cpp: In member function 'rgl::Vec3 rgl::BBoxDeco::marginVecToDataVec(rgl::Vec3, rgl::RenderContext*, rgl::Material*)':
BBoxDeco.cpp:827:14: warning: 'line' may be used uninitialized in this function [-Wmaybe-uninitialized]
   result[line] = marginvec.y*scale[line] + trans[line];
              ^
BBoxDeco.cpp: In member function 'rgl::Vec3 rgl::BBoxDeco::marginNormalToDataNormal(rgl::Vec3, rgl::RenderContext*, rgl::Material*)':
BBoxDeco.cpp:840:40: warning: 'line' may be used uninitialized in this function [-Wmaybe-uninitialized]
   result[line] = marginvec.y/scale[line];
                                        ^
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Background.cpp -o Background.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c ClipPlane.cpp -o ClipPlane.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Color.cpp -o Color.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Disposable.cpp -o Disposable.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Light.cpp -o Light.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c LineSet.cpp -o LineSet.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c LineStripSet.cpp -o LineStripSet.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Material.cpp -o Material.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c NULLgui.cpp -o NULLgui.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c PlaneSet.cpp -o PlaneSet.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c PointSet.cpp -o PointSet.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c PrimitiveSet.cpp -o PrimitiveSet.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RenderContext.cpp -o RenderContext.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Shape.cpp -o Shape.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c SphereMesh.cpp -o SphereMesh.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c SphereSet.cpp -o SphereSet.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c SpriteSet.cpp -o SpriteSet.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c String.cpp -o String.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Surface.cpp -o Surface.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c TextSet.cpp -o TextSet.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Texture.cpp -o Texture.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Viewpoint.cpp -o Viewpoint.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c api.cpp -o api.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c assert.cpp -o assert.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c callbacks.cpp -o callbacks.o
callbacks.cpp: In function 'void userAxis(void*, int, int*)':
callbacks.cpp:188:17: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   for (i = 0; i < 3 & j < 3; i++) {
               ~~^~~
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c device.cpp -o device.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c devicemanager.cpp -o devicemanager.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c fps.cpp -o fps.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c ftgl.cpp -o ftgl.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c geom.cpp -o geom.o
"C:/RBuildTools/4.0/mingw32/bin/"gcc  -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c gl2ps.c -o gl2ps.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c glErrors.cpp -o glErrors.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c glgui.cpp -o glgui.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c gui.cpp -o gui.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c init.cpp -o init.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c par3d.cpp -o par3d.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c pixmap.cpp -o pixmap.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c platform.cpp -o platform.o
"C:/RBuildTools/4.0/mingw32/bin/"gcc  -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c pretty.c -o pretty.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c render.cpp -o render.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c rglmath.cpp -o rglmath.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c rglview.cpp -o rglview.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c scene.cpp -o scene.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c select.cpp -o select.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c subscene.cpp -o subscene.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c win32gui.cpp -o win32gui.o
win32gui.cpp: In member function 'virtual rgl::GLFont* rgl::Win32WindowImpl::getFont(const char*, int, double, bool)':
win32gui.cpp:449:22: warning: unused variable 'pidlFonts' [-Wunused-variable]
         LPITEMIDLIST pidlFonts;
                      ^~~~~~~~~
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c win32lib.cpp -o win32lib.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c x11gui.cpp -o x11gui.o
"C:/RBuildTools/4.0/mingw32/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c x11lib.cpp -o x11lib.o
C:/RBuildTools/4.0/mingw32/bin/g++ -shared -s -static-libgcc -o rgl.dll rgl-win.def ABCLineSet.o BBoxDeco.o Background.o ClipPlane.o Color.o Disposable.o Light.o LineSet.o LineStripSet.o Material.o NULLgui.o PlaneSet.o PointSet.o PrimitiveSet.o RenderContext.o Shape.o SphereMesh.o SphereSet.o SpriteSet.o String.o Surface.o TextSet.o Texture.o Viewpoint.o api.o assert.o callbacks.o device.o devicemanager.o fps.o ftgl.o geom.o gl2ps.o glErrors.o glgui.o gui.o init.o par3d.o pixmap.o platform.o pretty.o render.o rglmath.o rglview.o scene.o select.o subscene.o win32gui.o win32lib.o x11gui.o x11lib.o -L../windows/freetype-2.10.4/lib/i386 -lfreetype -lpng -lz -lgdi32 -lopengl32 -lglu32 -LC:/PROGRA~1/R/R-41~1.0/bin/i386 -lR
installing to C:/Users/zavud/Documents/R/win-library/4.1/00LOCK-rgl/00new/rgl/libs/i386

*** arch - x64
"C:/PROGRA~1/R/R-41~1.0/bin/x64/Rscript.exe" "../tools/winlibs.R" 2.10.4
sed -e "s^@RGL_NO_OPENGL@^FALSE^" ../R/noOpenGL.R.in > ../R/noOpenGL.R
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c ABCLineSet.cpp -o ABCLineSet.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c BBoxDeco.cpp -o BBoxDeco.o
BBoxDeco.cpp: In member function 'rgl::Vec3 rgl::BBoxDeco::marginVecToDataVec(rgl::Vec3, rgl::RenderContext*, rgl::Material*)':
BBoxDeco.cpp:827:14: warning: 'line' may be used uninitialized in this function [-Wmaybe-uninitialized]
   result[line] = marginvec.y*scale[line] + trans[line];
              ^
BBoxDeco.cpp: In member function 'rgl::Vec3 rgl::BBoxDeco::marginNormalToDataNormal(rgl::Vec3, rgl::RenderContext*, rgl::Material*)':
BBoxDeco.cpp:840:40: warning: 'line' may be used uninitialized in this function [-Wmaybe-uninitialized]
   result[line] = marginvec.y/scale[line];
                                        ^
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Background.cpp -o Background.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c ClipPlane.cpp -o ClipPlane.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Color.cpp -o Color.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Disposable.cpp -o Disposable.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Light.cpp -o Light.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c LineSet.cpp -o LineSet.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c LineStripSet.cpp -o LineStripSet.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Material.cpp -o Material.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c NULLgui.cpp -o NULLgui.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c PlaneSet.cpp -o PlaneSet.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c PointSet.cpp -o PointSet.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c PrimitiveSet.cpp -o PrimitiveSet.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RenderContext.cpp -o RenderContext.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Shape.cpp -o Shape.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c SphereMesh.cpp -o SphereMesh.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c SphereSet.cpp -o SphereSet.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c SpriteSet.cpp -o SpriteSet.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c String.cpp -o String.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Surface.cpp -o Surface.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c TextSet.cpp -o TextSet.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Texture.cpp -o Texture.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c Viewpoint.cpp -o Viewpoint.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c api.cpp -o api.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c assert.cpp -o assert.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c callbacks.cpp -o callbacks.o
callbacks.cpp: In function 'void userAxis(void*, int, int*)':
callbacks.cpp:188:17: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   for (i = 0; i < 3 & j < 3; i++) {
               ~~^~~
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c device.cpp -o device.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c devicemanager.cpp -o devicemanager.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c fps.cpp -o fps.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c ftgl.cpp -o ftgl.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c geom.cpp -o geom.o
"C:/RBuildTools/4.0/mingw64/bin/"gcc  -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c gl2ps.c -o gl2ps.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c glErrors.cpp -o glErrors.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c glgui.cpp -o glgui.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c gui.cpp -o gui.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c init.cpp -o init.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c par3d.cpp -o par3d.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c pixmap.cpp -o pixmap.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c platform.cpp -o platform.o
"C:/RBuildTools/4.0/mingw64/bin/"gcc  -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c pretty.c -o pretty.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c render.cpp -o render.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c rglmath.cpp -o rglmath.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c rglview.cpp -o rglview.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c scene.cpp -o scene.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c select.cpp -o select.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c subscene.cpp -o subscene.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c win32gui.cpp -o win32gui.o
win32gui.cpp: In member function 'virtual rgl::GLFont* rgl::Win32WindowImpl::getFont(const char*, int, double, bool)':
win32gui.cpp:449:22: warning: unused variable 'pidlFonts' [-Wunused-variable]
         LPITEMIDLIST pidlFonts;
                      ^~~~~~~~~
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c win32lib.cpp -o win32lib.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c x11gui.cpp -o x11gui.o
"C:/RBuildTools/4.0/mingw64/bin/"g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -Iext/ftgl -I../windows/freetype-2.10.4/include -I../windows/freetype-2.10.4/include/freetype2         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c x11lib.cpp -o x11lib.o
C:/RBuildTools/4.0/mingw64/bin/g++ -shared -s -static-libgcc -o rgl.dll rgl-win.def ABCLineSet.o BBoxDeco.o Background.o ClipPlane.o Color.o Disposable.o Light.o LineSet.o LineStripSet.o Material.o NULLgui.o PlaneSet.o PointSet.o PrimitiveSet.o RenderContext.o Shape.o SphereMesh.o SphereSet.o SpriteSet.o String.o Surface.o TextSet.o Texture.o Viewpoint.o api.o assert.o callbacks.o device.o devicemanager.o fps.o ftgl.o geom.o gl2ps.o glErrors.o glgui.o gui.o init.o par3d.o pixmap.o platform.o pretty.o render.o rglmath.o rglview.o scene.o select.o subscene.o win32gui.o win32lib.o x11gui.o x11lib.o -L../windows/freetype-2.10.4/lib/x64 -lfreetype -lpng -lz -lgdi32 -lopengl32 -lglu32 -LC:/PROGRA~1/R/R-41~1.0/bin/x64 -lR
installing to C:/Users/zavud/Documents/R/win-library/4.1/00LOCK-rgl/00new/rgl/libs/x64
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'rgl'
    finding HTML links ... done
    3dobjects                               html  
    GramSchmidt                             html  
    abclines                                html  
    addNormals                              html  
    ageControl                              html  
    ageSetter                               html  
    all.equal.mesh3d                        html  
    arc3d                                   html  
    arrow3d                                 html  
    as.mesh3d.ashape3d                      html  
    as.mesh3d.default                       html  
    as.mesh3d.rglId                         html  
    as.triangles3d                          html  
    asRow                                   html  
    aspect3d                                html  
    attributes                              html  
    axes3d                                  html  
    bbox                                    html  
    bg                                      html  
    bgplot3d                                html  
    callbacks                               html  
    check3d                                 html  
    clipMesh3d                              html  
    clipplaneControl                        html  
    contourLines3d                          html  
    cube3d                                  html  
    cylinder3d                              html  
    decorate3d                              html  
    drape3d                                 html  
    elementId2Prefix                        html  
    ellipse3d                               html  
    expect_known_scene                      html  
    extrude3d                               html  
    facing3d                                html  
    figWidth                                html  
    grid3d                                  html  
    identify3d                              html  
    import                                  html  
REDIRECT:topic   %>% -> import.html [ FAIL ]
    in_pkgdown_example                      html  
    light                                   html  
    makeDependency                          html  
    material                                html  
    matrices                                html  
    merge.mesh3d                            html  
    mergeVertices                           html  
    mesh3d                                  html  
    mfrow3d                                 html  
    observer3d                              html  
    open3d                                  html  
    par3d                                   html  
    par3dinterp                             html  
    par3dinterpControl                      html  
    pch3d                                   html  
    persp3d                                 html  
    persp3d.deldir                          html  
    persp3d.function                        html  
    persp3d.tri                             html  
    planes                                  html  
    play3d                                  html  
    playwidget                              html  
    finding level-2 HTML links ... done

    plot3d                                  html  
    plot3d.formula                          html  
    plot3d.lm                               html  
    plotmath3d                              html  
    polygon3d                               html  
    postscript                              html  
    primitive                               html  
    propertyControl                         html  
    propertySetter                          html  
    r3d                                     html  
    readSTL                                 html  
    rgl-internal                            html  
    rgl-package                             html  
REDIRECT:topic   Previous alias or file overwritten by alias: C:/Users/zavud/Documents/R/win-library/4.1/00LOCK-rgl/00new/rgl/help/RGL.html
    rgl.Sweave                              html  
    rgl.attrib.info                         html  
    rgl.bringtotop                          html  
    rgl.fns                                 html  
    rgl.init                                html  
    rgl.open                                html  
    rgl.pixels                              html  
    rgl.select                              html  
    rgl.setAxisCallback                     html  
    rgl.texts                               html  
    rgl.useNULL                             html  
    rgl.user2window                         html  
    rglExtrafonts                           html  
    rglIds                                  html  
    rglMouse                                html  
    rglShared                               html  
    rglToLattice                            html  
    rglwidget                               html  
    scene                                   html  
    scene3d                                 html  
    sceneChange                             html  
    select3d                                html  
    selectpoints3d                          html  
    setAxisCallbacks                        html  
    setGraphicsDelay                        html  
    setUserCallbacks                        html  
    setUserShaders                          html  
    setupKnitr                              html  
    shade3d                                 html  
    shadow3d                                html  
    shapelist3d                             html  
    shiny                                   html  
    shinyGetPar3d                           html  
    show2d                                  html  
    snapshot                                html  
    spheres                                 html  
    spin3d                                  html  
    sprites                                 html  
    subdivision3d                           html  
    subscene3d                              html  
    subsceneInfo                            html  
    surface                                 html  
    surface3d                               html  
    texts                                   html  
    thigmophobe3d                           html  
    tkpar3dsave                             html  
    tkrgl                                   html  
    tkspin3d                                html  
    tkspinControl                           html  
    toggleWidget                            html  
    triangulate                             html  
    turn3d                                  html  
    vertexControl                           html  
    viewpoint                               html  
    webGLcontrols                           html  
    writeASY                                html  
    writeOBJ                                html  
    writePLY                                html  
    writeWebGL                              html  
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
*** arch - i386
*** arch - x64
** testing if installed package can be loaded from final location
*** arch - i386
*** arch - x64
** testing if installed package keeps a record of temporary installation path
* DONE (rgl)
tylermorganwall commented 3 years ago

Is this only happening with your data, or can you run the following code and get a draggable 3D plot?

volcano %>%
  sphere_shade() %>%
  plot_3d(volcano)
zavud commented 3 years ago

This one does give me a draggable 3D plot. Perhaps something is wrong with the elevation data I downloaded from the website you showed in this tutorial. I wander why would it be the case?

tylermorganwall commented 3 years ago

Yes, it's likely something in the data, or an issue while processing the data. If you can post your full script I can help you debug.

zavud commented 3 years ago

Here is the full script. Please, note that I have made some comments about some errors etc.:

library(rayshader)
library(sp)
library(raster)
library(scales)

# load elevation data
el_files = list.files(pattern = ".hgt", full.names = T)
el1 = raster::raster(el_files[1])
el2 = raster::raster(el_files[2])
el = raster::merge(el1, el2)
rm(el1, el2)

plot(el)
#height_shade(raster_to_matrix(el)) %>% plot_map()

# load raster image
raster_files = list.files(pattern = ".TIF")
r = raster_files[3] |> raster::raster()
g = raster_files[2] |> raster::raster()
b = raster_files[1] |> raster::raster()
rgb = raster::stack(r, g, b)
plotRGB(rgb, scale = 255^2)
rgb_corrected = sqrt(raster::stack(r, g, b))
plotRGB(rgb_corrected)

# combining the 2 datasets
raster::crs(el)
raster::crs(r)

el = raster::projectRaster(el, crs = crs(r), method = "bilinear")
crs(el)

# crop to the study area
shp = rgdal::readOGR("vector_study_area_rectangle") # this is a polygon of my study area
shp = shp[shp$fid==1,]
plot(shp)
crs(shp) = crs(r)
crs(shp)

el_cropped = crop(el, shp)
rgb_cropped = crop(rgb_corrected, shp)
plot(el_cropped)

names(rgb_cropped) = c("r", "g", "b")
names(rgb_cropped)

r = raster_to_matrix(rgb_cropped$r)
g = raster_to_matrix(rgb_cropped$g)
b = raster_to_matrix(rgb_cropped$b)

el_mat = raster_to_matrix(el_cropped)

rgb_array = array(0, dim = c(nrow(r), ncol(r), 3))
dim(rgb_array)

rgb_array[,,1] = r / 255
rgb_array[,,2] = g / 255
rgb_array[,,3] = b / 255

rgb_array = aperm(rgb_array, c(2, 1, 3))

plot_map(rgb_array) # this gives an error saying: Error in grDevices::rgb(RGB[, 1], RGB[, 2], RGB[, 3], alpha = alpha, maxColorValue = scale) : color intensity 1.00391, not in [0,1]
rgb_contrast = scales::rescale(rgb_array, to=c(0, 1))
plot_map(rgb_contrast) # this code produces a really dark image

# the following code is the last code that i can run before r crashing
# this opens an rgl window, that is static and r crashes when i close it
plot_3d(rgb_contrast, el_mat, windowsize = c(1100,900), zscale = 15, shadowdepth = -50,
        zoom=0.5, phi=45,theta=-45,fov=70, background = "#F2E1D0", shadowcolor = "#523E2B")

Here is the static 3D plot (using only plot_3d(rgb_contrast, el_mat):

image

tylermorganwall commented 3 years ago

What happens when you only use el_mat along with rayshader functions to create the 3D plot? E.g.


el_mat |>
  sphere_shade() |>
  plot_3d(el_mat,zscale=15)

Also, what's the output of range(rgb_array) before scaling?

zavud commented 3 years ago

This opens a small rgl window with nothing appearing (please see the screenshot below). Also, when I close this window, R crashes again.

el_mat |>
  sphere_shade() |>
  plot_3d(el_mat,zscale=15)

Rgl window

Also:

> range(rgb_array)
[1] 0.307637 1.003914
tylermorganwall commented 3 years ago

What's does range(el_mat) report, and what does image(el_mat, useRaster = TRUE) look like? It looks like there's something odd with your elevation matrix.

zavud commented 3 years ago
> range(el_mat)
[1] 262.4992 819.5355
> image(el_mat, useRaster = TRUE)

Rplot

tylermorganwall commented 3 years ago

What does dim(el_mat), dim(rgb_contrast), class(el_mat), and class(rgb_contrast) return?

zavud commented 3 years ago
> dim(el_mat)
[1] 1151  656
> dim(rgb_contrast)
[1] 675 772   3
> class(el_mat)
[1] "matrix" "array" 
> class(rgb_contrast)
[1] "array"
tylermorganwall commented 3 years ago

Can you control the camera with render_camera()?

zavud commented 3 years ago

Yes I can. I used the examples in this webpage and the render_camera() indeed seems to work fine.

tylermorganwall commented 3 years ago

Do you have a link to the actual data that is causing this issue?

zavud commented 3 years ago

You mean the elevation data I downloaded from the website you show in the tutorial? If so, I have the extent of the area which is contained by 2 "squares" in that database. It means you would need to download 2 of them, merge and crop the specific area.

tylermorganwall commented 3 years ago

Yes. In order to determine if there's an issue, I need a fully reproducible example with the code and data.

glorious1 commented 3 years ago

This is a long thread, but I didn't see where you said exactly how you are closing the rgl window. If you're doing it manually in the OS, yes, that will crash R in my experience. If you do it in R with rgl::rgl.close(), you should be okay.

tylermorganwall commented 2 years ago

Closing because R crashing when the X11 window is closed is an rgl issue.