I want to create a rgl widget with a slider using playwidget() including a different text annotation for each subset.
If I run the following
clear3d()
a1 <- spheres3d(xyz.coords(matrix(sample.int(100, 81), ncol = 3)), col="blue", radius = 2)
text3d(10, 10, 10, "text1")
a2 <- spheres3d(xyz.coords(matrix(sample.int(100, 27), ncol = 3)), col="red", radius = 2)
text3d(30, 5, 5, "text2")
a3 <- spheres3d(xyz.coords(matrix(sample.int(100, 9), ncol = 3)), col="green", radius = 2)
text3d(5, 5, 50, "text3")
rglwidget() %>%
playwidget(start = 0, stop = 2, interval = 1,
components = c("Reverse", "Play", "Slower", "Faster",
"Reset", "Slider", "Label"),
labels = c("a1", "a2", "a3"),
subsetControl(1, subsets = list(aa=a1,bb=a2,cc=a3)))
I get the 3 text annotations fixed for all subsets. Any idea on how to fix this?
A more general question is how to bind additional rglLowlevel objects (such as box3d()) to each single subset so to be changing when moving the slider bar.
Thanks