1

I am trying to implement this spectacular visualization tool and the only thing that seems to get in the way is to be able of overlapping raster layers over the 3dplot, How could that be possible? I tried add_overlay,but I cannot understand how to proceed from the error message.

library(raster)
library(rayshader)
altc=getData('alt', country='MOZ',mask=T)
elevation_matrix = raster_to_matrix(altc)

y=raster("https://www.dropbox.com/s/zhsu204du0rgbjp/Tlim_margins_Mozambique.grd?dl=0")

mat_reduced <- resize_matrix(elevation_matrix, 0.7)

mat_reduced |>
sphere_shade(texture = create_texture(lightcolor = "white",
shadowcolor = "black",
leftcolor = "grey",
rightcolor = "grey",
centercolor = "grey",
cornercolors = c(NW = "#ffc500",
NE = "#387642",
SW = "#d27441",
SE = "#296176")),
colorintensity=0.12,
 sunangle = 45) |>

plot_3d(mat_tx_reduced,
windowsize = c(800, 600),
zscale = 200,
zoom = 0.65,
phi = 80,
theta = 0,
fov = 0,
shadow = TRUE,
shadowcolor = "#5da5da",
 water = TRUE,
watercolor= "lightblue",
 waterlinecolor="lightblue")|>
 add_overlay(overlay=y, alphalayer = 0.5)
 Error in .local(x, i = i, j = j, ..., value) : unused argument (value)
user2554330
  • 37,248
  • 4
  • 43
  • 90
Agus camacho
  • 868
  • 2
  • 9
  • 24

0 Answers0