tylermorganwall / rayshader

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

TinyObjReader and can't show the 3D figure in Rstudio [BUG] #259

Closed fermidq closed 1 year ago

fermidq commented 1 year ago

Describe the bug My environment is Ubuntu 22.04.1 LTS, with R 4.1.2 and Rstudio Server 2022.08.2 Build 576. I tried the example of "volcano" in the "readme.md" file and other my own dataset. In the last, when running "render_snapshot()", it shows "TinyObjReader: Degenerated face found" and only the gray bottom is shown. The colored line and topography is not shown. With my own data, the same error is shown.

Following is my code.

library(rayshader)
library(reshape2)
#Contours and other lines will automatically be ignored. Here is the volcano dataset:

ggvolcano = volcano %>% 
  melt() %>%
  ggplot() +
  geom_tile(aes(x = Var1, y = Var2, fill = value)) +
  geom_contour(aes(x = Var1, y = Var2, z = value), color = "black") +
  scale_x_continuous("X", expand = c(0, 0)) +
  scale_y_continuous("Y", expand = c(0, 0)) +
  scale_fill_gradientn("Z", colours = terrain.colors(10)) +
  coord_fixed()

plot_gg(ggvolcano, multicore = TRUE, raytrace = TRUE, width = 7, height = 4, 
        scale = 300, windowsize = c(1400, 866), zoom = 0.6, phi = 30, theta = 30)
Sys.sleep(2)
render_snapshot(clear = TRUE)
#Your code goes below

So how can resolve this problem?

tylermorganwall commented 1 year ago

Please be sure to include all the information requested in the issue template when you create an issue. It appears you have an outdated version of rayshader—install the latest version from github and you should not have this problem.

remotes::install_github("tylermorganwall/rayshader")