rglSetMouseCbTrackball | R Documentation |
'rglSetMouseCbTrackball' sets mouse "trackball" callback for given
button
on selected device(s), such that interaction made using the
given button
affects all the devices (and all their subscenes, by
default).
The code is mostly based on the 'mouseCallbacks' demo from the 'rgl' package.
rglSetMouseCbTrackball(dev = rgl.cur(),
button = 1, affectSubscenes = TRUE)
dev |
device(s) to set callback for |
button |
|
affectSubscenes |
if TRUE, interaction affects all subscenes in a device, not only the current one |
Tomas Sieger
if (interactive() && require(rgl)) {
dev1 <- open3d()
shade3d(cube3d(color = rep(rainbow(6), rep(4, 6))))
dev2 <- open3d()
mfrow3d(1, 2, sharedMouse = TRUE)
shade3d(cube3d(color = rep(rainbow(6), rep(4, 6))))
next3d()
shade3d(cube3d(color = rep(rainbow(6), rep(4, 6))))
rglSetMouseCbTrackball(c(dev1, dev2))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.