'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)

Arguments

dev

device(s) to set callback for

button

button to set callback for

affectSubscenes

if TRUE, interaction affects all subscenes in a device, not only the current one

Examples

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)) }