How to make timelapse rayshader terrain animation using satellite images?

I want to create a timelapse visualization of terrain motion using rayshader packages. I found this web article https://labo.obs-mip.fr/multitemp/khumbu-icefall-in-4d/ which gives useful tip by using Venµs satellite images. The stunning animation is from this article
labo_obs-mip_fr-3Drot (1).

I am new to R but I can manage it by working in sample scripts. In the article the scripts used are

library(rayshader)
library(abind)
library(raster)
p="./"
fdem=paste0(p,"HMA_DEM8m_MOS_20170716_tile-677_UTM45_filled_crop_Venus.tif")
pimg=paste0(p,"/VIS1C/")

dem=raster(fdem)
elmat=matrix(extract(dem, extent(dem), buffer = 1000),nrow = ncol(dem), ncol = nrow(dem))

files=list.files(path=pimg, pattern="jpg$", full.names=FALSE, recursive=FALSE)

# rotating view  
th=200
k=0
for (x in files) {
    fimg=paste0(pimg,x)
    fout=paste0(p,"/3Drot/",x)
    print(x)
    txt=substr(x, 36, 43)
    k=k+1
    if (k<length(files)/2){
    th=th+0.5
    }else{
    th=th-0.5
    }
    imgr = raster(fimg,band=1)
    imgg = raster(fimg,band=2)
    imgb = raster(fimg,band=3)
    r = t(matrix(extract(imgr, extent(imgr), buffer = 1000),nrow = ncol(imgr), ncol = nrow(imgr)))
    g = t(matrix(extract(imgg, extent(imgr), buffer = 1000),nrow = ncol(imgr), ncol = nrow(imgr)))
    b = t(matrix(extract(imgb, extent(imgr), buffer = 1000),nrow = ncol(imgr), ncol = nrow(imgr)))
    col=abind(r,g,b,along=3)/255
    plot_3d(col, elmat, zscale = 5, fov = 0, theta = th, zoom = 0.7, phi = 45, windowsize = c(1000, 800))
    render_snapshot(fout,clear = TRUE,title_text = txt, title_color = "black",
               title_font = "Arial", gravity = "NorthEast", title_offset = c(0,0))
    }

How do I implement this process with Sentinel 2 satellite images?

Please help
Regards,
Gokul

Tyler, the creator of rayshader, has written this useful guide:

If you're working with Sentinel-2 data specifically, I found this useful:

Hope this helps!

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

​I have checked both articles. Both are really helpful if one is approaching for single image animation. But I have time-series data from sentinel hub. My problem will be solved if I can animate all the images in the scene​ Just like in gif I posted in the question.

My file structure is,
Satellite images

DEM
2020-05-16_12h40_38