if (interactive() && !in_pkgdown_example()) {
  # Record a series of positions, and then play them back immediately
  # at evenly spaced times, in an oscillating loop
  example(plot3d)
  play3d( par3dinterp( tkpar3dsave() ) )
  # As above, but preserve the click timings
  # play3d( par3dinterp( tkpar3dsave(times=TRUE) ) )
}
Run the code above in your browser using DataLab