Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webshot2 slows down snapshot3d considerably #113

Closed
Alexander-Ling opened this issue Jul 8, 2021 · 1 comment
Closed

Webshot2 slows down snapshot3d considerably #113

Alexander-Ling opened this issue Jul 8, 2021 · 1 comment

Comments

@Alexander-Ling
Copy link

  • rgl Version: 0.106.23
  • R Version: 4.1.0
  • Platform: x86_64-w64-mingw32/x64 (64-bit)

I'm not sure if this counts as a true bug, but I find that the movie3d function operates about 100x slower if I have the webshot2 package installed vs if I have it uninstalled. I don't know whether this is a problem with snapshot3d, webshot2, or something about my system. Maybe this is even to be expected from webshot2. However, it would be nice if a "use_webshot" argument could be added to the movie3d function to control whether or not the call to snapshot3d sets "webshot = TRUE".

For the moment, I'll either just leave webshot2 uninstalled or I'll save a slightly modified version of movie3d which defaults webshot to FALSE in the snapshot3d call.

Regardless, thanks for the great package!

Code to reproduce below, though I suspect this behavior is system specific.

require(car)
require(rgl)

#Creating mock dataset
  Example_Data <- data.frame(Axis1 = rnorm(100),
                             Axis2 = rnorm(100),
                             Axis3 = rnorm(100))

#Creating scatter3d plot
  scatter3d(x = Example_Data$Axis1, y = Example_Data$Axis2, z = Example_Data$Axis3, xlab = "Axis1", ylab = "Axis2", zlab = "Axis3", surface = F, grid = F, ellipsoid = F, fogtype = "none")

#Saving movie snapshots without webshot2 installed
  system.time(movie3d(spin3d(axis = c(0,1,0), rpm = 5), duration = 12, dir = getwd(), fps = 5, convert = FALSE, clean = FALSE))
  #Time elapsed is 1.25 seconds with webshot2 package uninstalled
  
#Saving movie snapshot with webshot2 installed
  remotes::install_github("rstudio/webshot2")

  system.time(movie3d(spin3d(axis = c(0,1,0), rpm = 5), duration = 12, dir = getwd(), fps = 5, convert = FALSE, clean = FALSE)) 
  #Time elapsed is 110.86 seconds with webshot2 package installed

  remove.packages("webshot2")
dmurdoch added a commit that referenced this issue Jul 8, 2021
dmurdoch added a commit that referenced this issue Jul 8, 2021
@dmurdoch
Copy link
Owner

dmurdoch commented Jul 8, 2021

Thanks for the report -- I hadn't noticed that. I've just committed your suggested change.

@dmurdoch dmurdoch closed this as completed Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants