[Rd] navigation mode(s) in rgl

Duncan Murdoch murdoch.duncan at gmail.com
Thu Nov 5 04:01:25 CET 2015

On 04/11/2015 6:56 PM, Michael Sumner wrote:
> Hello, I've CCd' Duncan Murdoch as the rgl maintainer, but I'm also keen to
> hear from the broader community of any insights.
> In rgl my understanding is that there's only one rotation-navigation mode,
> where you left-click hold and the view pivots abound the centre of the
> scene.

That's not quite true:  there are several modes built in, and the
possibility of adding your own.

> In other tools, including Google Earth, that is the default behaviour but
> there's also a click-centric mode where the view pivots about the point
> clicked on.
> I haven't found the right terminology for this, but I call it
> 1) Data-centric navigation, rotating about the centre of the data in  the
> scene (invoked by left-click-drag in rgl and GE and others)
> 2) Click-centric navigation, rotating about the point clicked on (invoked
> by centre-click-drag in GE and others, but not rgl)
> My questions:
> 1) I'd appreciate any guidance on my terminology here, whether I'm making
> sense and ask for pointers to resources that explore this properly
> 2) Is there scope to add this "click-centric" navigation to rgl? I'd
> appreciate any pointers to how it could be done - is it an rgl-level
> feature, or deeper down?

If I understand your description properly, you can add it using the
"user" mouse mode (see ?par3d).  You should also see that help topic for
a description of how rendering is done, and ?rgl.setMouseCallbacks
for an example of doing it.

The hard part in doing this is in working out *exactly* what you want
the mouse to do.  If you work that out for the mode you want but find
the "user" mode is unsatisfactory for some reason, I'd be willing to add
it as another built in mode.

Duncan Murdoch

> I know that "click-centric" clicked-on point has a different meaning in
> different contexts, in GE clearly it finds the nearest point intersecting
> the globe surface since that is a always-present structure, but other tools
> must have rules to specify where the pivot point is - either intersecting a
> data element or somewhere in the scene.
> The data-centric mode is fine for small scenes with a limited scope, but
> when the extent covered by data is large it's quite unwieldy to focus in on
> specific parts of the scene. I know this could be controlled by
> pushing/popping elements in the scene but the navigation mode obviously
> offers more flexibility.

More information about the R-devel mailing list