natverse / nat

NeuroAnatomy Toolbox: An R package for the (3D) visualisation and analysis of biological image data, especially tracings of single neurons.

Home Page:https://natverse.org/nat/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scroll to zoom does not work using nopen3d()

kjheinz opened this issue · comments

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.

So it seems that the change from a 3-vector to a 4-vector for mouseMode happened a long time ago (v0.94.1131 cran/rgl@d33cbfc). 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.

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