saveopts <- options(rgl.useNULL = TRUE)
xyz <- matrix(rnorm(300), ncol = 3)
id <- rgl::plot3d(xyz, type="s", col = "blue", zlim = c(-3,3))["clipplanes"]
dvals <- c(3, -3)
rglwidget(width=500, height=300) %>%
playwidget(clipplaneControl(d = dvals, clipplaneids = id),
start = 0, stop = 1, step = 0.01,
rate = 0.5)
options(saveopts)
Run the code above in your browser using DataLab