natverse / nat

NeuroAnatomy Toolbox: An R package for the (3D) visualisation and analysis of biological image data, especially tracings of single neurons.
https://natverse.org/nat/
64 stars 28 forks source link

scroll to zoom does not work using nopen3d() #413

Closed kjheinz closed 4 years ago

kjheinz commented 5 years ago

Using nopen3d() to open a 3d viewer I can no longer scroll to zoom (though pressing and holding the middle mouse button works).

I suspect this is due to a change in how par3d() reads the mouseMode argument - I can fix the issue by changing the first line of the nopen3d() source code from res = open3d(mouseMode = c("trackball", "user", "zoom"), FOV = FOV, ...) to res = open3d(mouseMode = c("trackball", "user", "zoom", "pull"), FOV = FOV, ...)

I have not been able to find out when this changed in rgl (I am on version 0.100.30), but looking over previous versions the 4-argument version of mouseMode seems to have been the preferred approach for some time.

jefferis commented 5 years ago

So it seems that the change from a 3-vector to a 4-vector for mouseMode happened a long time ago (v0.94.1131 https://github.com/cran/rgl/commit/d33cbfc1cd3da747da2aaf27dc12f49ac7dfa910). We already depend on rgl (>= 0.98.1), so we do not need to increase that version requirement. There must have been some other more recent change that affects how the mouseMode vector is handled, but the conclusion is that we can happily use the 4-vector version.

jefferis commented 5 years ago

In fact that there is an updated version of the pan3d function in the rgl docs as of v 0.100.18. Blame for this at:

https://github.com/cran/rgl/blame/12cf653caa074bf96f08c00d954a418dae928dd8/man/callbacks.Rd#L57-L82