rgl icon indicating copy to clipboard operation
rgl copied to clipboard

Issue displaying 3D plots in rgl/lidR on MacOS

Open ColinPSweeney opened this issue 8 months ago • 9 comments

I am having an issue displaying LiDAR pointclouds using lidR/rgl since updating my MacOS operating system to macOS Sonoma 14.3.1 and lidR package to version 4.1.1. I am currently using rgl version 1.3.1

Previously I was able to plot pointclouds in a previous version of lidR using XQuartz. When I try lidR::plot(las), I don't get any errors or plots.

lidR uses the rgl package to create it's 3D plots. When I tried library(rgl), I get the following error: "This build of rgl does not include OpenGL functions. Use rglwidget() to display results, e.g. via options(rgl.printRglwidget = TRUE)."

I am able to get some 3D plots to work using:

options(rgl.printRglwidget = TRUE)

AND

with(iris, plot3d(Sepal.Length, Sepal.Width, Petal.Length, type="s", col=as.numeric(Species)))

However, this does not fix lidR::plot(las). When I try las plots, not pop up appears.

My guess is that somehow XQuartz is not talking to the rgl package properly. I tried reinstalling XQuartz with homebrew and am currently using version 2.8.5. Not sure if this is an rgl or XQuartz issue, but I thought I would try here first. Any thoughts are appreciated! (Cross posted on stackoverflow here: https://stackoverflow.com/questions/78614609/error-in-displaying-3d-plots-in-rgl-lidr-on-macos)

ColinPSweeney avatar Jun 13 '24 02:06 ColinPSweeney