Black Lives Matter. Please consider donating to Black Girls Code today.

I would like to apply an animation to a "mesh3D", or "surface" type, in R Plotly

R Plotly, “Mesh3D” I would like to graph the type “surface” and move it into an animation. I do not want complicated movements, and I want to make some moving animations.
I have seen animation examples, but they are not easy to understand.

CLICK /// example animations




Below is a mesh3D example and a surface example. In this example(code), can you create an animation that moves the “helicopter” and “circle” slightly in a certain direction? I need help.




# helicopter R code 
library(plotly)
library(geomorph)

    plyFile <- 'http://people.sc.fsu.edu/~jburkardt/data/ply/chopper.ply'



dest <- basename(plyFile)
if (!file.exists(dest)) {
  download.file(plyFile, dest)
}

mesh <- read.ply(dest)


x <- mesh$vb["xpts",]
y <- mesh$vb["ypts",]
z <- mesh$vb["zpts",]
m <- matrix(c(x,y,z), ncol=3, dimnames=list(NULL,c("x","y","z")))

zmean <- apply(t(mesh$it),MARGIN=1,function(row){mean(m[row,3])})


library(scales)
facecolor = colour_ramp(
  brewer_pal(palette="RdBu")(10)
)(rescale(x=zmean))

plot_ly(
  x = x, y = y, z = z,
  i = mesh$it[1,]-1, j = mesh$it[2,]-1, k = mesh$it[3,]-1,
  facecolor = facecolor,
  type = "mesh3d"
)




#circle R code
library(plotly)

R<-1 
xc<-0 
yc<-0 
zc<-5

theta <- seq(-pi, pi, length=30)
rad <- seq(0,R,length=30)

seeker.grid<-expand.grid(rad,theta)


v1 <- matrix(seeker.grid$Var1, nrow=length(rad))
v2 <- matrix(seeker.grid$Var2, nrow=length(rad))
v3 <- matrix(0,nrow = length(rad),ncol = length(theta))
Sx<- v1*cos(v2) + xc
Sy<- v1*sin(v2) + yc
Sz<- v3 + zc

plot_ly(x = Sx, y = Sy,z = Sz, type = "surface", opacity=0.99,showscale=FALSE)