rglSetMouseCbTrackball: Link the current device with others to share mouse control...

rglSetMouseCbTrackballR Documentation

Link the current device with others to share mouse control using the 'trackball' mode.

Description

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

Usage

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

Author(s)

Tomas Sieger

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

tsieger/tsiMisc documentation built on Oct. 10, 2023, 10:24 p.m.