Search code examples
rrgllidarlidr

Making nice GIF from LiDAR point cloud with R ( using lidR package ?)


Could someone point me to some R code to make programmatically nice GIF from LiDAR point clouds like the rotating one in the vignette of the LidR package (https://www.rdocumentation.org/packages/lidR/versions/3.0.3) ?


Solution

  • library(lidR)
    library(rgl)
    
    LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
    las = readLAS(LASfile)
    
    exportPath = tempfile()
    
    plot(las, bg = "white")
    movie3d(spin3d(), duration = 5, movie = exportPath)
    

    Check the documentation of movie3d and spin3d to control the speed and the number of frame.