Re: [R] How to chain user mouse handlers in rgl

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Sat, 01 Mar 2008 11:49:23 -0500

On 01/03/2008 5:41 AM, Dieter Menne wrote:
> Dear Rglers,
>
> With rgl, I would like to set marker when a button is pressed, but leave the
> standard trackball handling otherwise. Thanks to Duncan and Oleg for helping
> me handling key down.

I don't think there's currently an easy way to do that. What you would have to do is to replicate the trackball handler in yours. (You can see what it does in the src/rglview.cpp in the rgl source.)

If you want to write the R code (and docs for it) to fix this, I'll put it into rgl.

Duncan Murdoch

> How do I say in a custom mouse handler "after having done your work, forward
> to standard trackball once only"? The example below shows the idea, but it
> works only once, then reverts to standard trackball handling.
>
> Dieter
>
> #----------------------
> library(rgl)
> r3dDefaults
> open3d()
> shade3d(cube3d(color=rep(rainbow(6),rep(4,6))))
>
>
> btn3d <- function() {
> begin <- function(x, y) {
> # Add checking for key down later
> cat(x,y,"\n")
> # Forward to trackball (no easier way?)
> newhandler <- par3d("mouseMode")
> newhandler[1] <- "trackball"
> par3d(mouseMode = newhandler)
> }
> rgl.setMouseCallbacks(1, begin)
> }
>
> btn3d()
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 01 Mar 2008 - 16:51:53 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 01 Mar 2008 - 17:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive