How can I enable scroll wheel zoom on rgl rayshader plots?
Older (2019) rayshader plots seemed to have this functionality by default
(I can still open the old html files and they retain the functionality.)
However, plots generated today (2022) do not have scroll wheel zooming available.
Example from rayshader vignette
library(rayshader)
#Here, I load a map with the raster package.
loadzip = tempfile()
download.file("https://tylermw.com/data/dem_01.tif.zip", loadzip)
localtif = raster::raster(unzip(loadzip, "dem_01.tif"))
unlink(loadzip)
#And convert it to a matrix:
elmat = raster_to_matrix(localtif)
elmat %>%
sphere_shade(texture = "desert") %>%
add_water(detect_water(elmat), color = "desert") %>%
plot_3d(elmat, zscale = 10, fov = 0, theta = 135, zoom = 0.75, phi = 45, windowsize = c(1000, 800))
htmlwidgets::saveWidget(rgl::rglwidget(), "rayshader ex1.html")