Open cbeek-r7 opened 1 year ago
Hey Christiaan – I've had a look and I was able to make a similar visualisation for Mount Hood using the following code – I've simplified it a bit from my original DT script:
# devtools lets us install packages from GitHub
install.packages("devtools")
# install the rayshader package from GitHub
devtools::install_github("tylermorganwall/rayshader")
# install the rayvista package from GitHub
devtools::install_github("h-a-graham/rayvista", dependencies=TRUE)
# load all the packages needed
library(sf)
library(rayshader)
library(rayvista)
library(terrainr)
# Mount Hood coordinates:
# 45.3736, -121.6958
# plot via plot_3d_vista() function from rayvista
mount_hood <- plot_3d_vista(lat = 45.3736, long = -121.6958, zscale = 3,
overlay_detail = 16, windowsize = 800, zoom = 0.8,
theta = 240, phi = 25, solid = F)
# if you want to clear the plot:
# rgl::rgl.clear()
# render a video and save it locally as MH_movie.mp4
render_movie('MH_movie', type = 'orbit', frames = 720, fps = 30, vignette = c(0.7, 0.5))
The movie it produces: https://user-images.githubusercontent.com/18603830/209433193-6fbea955-1585-41d3-8934-7d5c1c4cd9b4.mp4
You'll probably want to play with the parameters in plot_3d_vista()
zscale
is the one which determines vertical exaggeration – 3 is just a bit of a guess from me but looking at it, I think it's slightly vertically exaggerated at the moment – I'm not sure if there's an easy way to know what this should be to be an accurate height (ie zero vertical exaggeration) without specifying your own DEMoverlay_detail
specifies how detailed the aerial imagery should be, if you want it to run more quickly change this to something less than 16Many thanks for your reply and explanations - really appreciate it!!
As an absolute newbie on this area - I love your 3D map of DT and spinning - when I change the Lat/Long let's say for Mount Hood in Oregon, I do get all kinds of errors. Can you point me out where in the script I need to look for and change when I use other coordinates/locations please?
Appreciate your guidance/help,
C.