Re: [R] Defining origin for rotation in RGL device

From: Duncan Murdoch <murdoch.duncan_at_gmail.com>
Date: Mon, 25 Apr 2011 07:54:58 -0400

On 25/04/2011 5:46 AM, Mark Heckmann wrote:
> Hi all,
>
> How can I tell RGL to set the center for the rotation to the origin of the coordinate system (0,0,0).
> It seems that the default is to use the center of the display not the origin of the coordinate system.
>
> open3d()
> lines3d(c(0, 1), c(0,0), c(0,0))
> lines3d(c(0,0), c(0, 1), c(0,0))
> lines3d(c(0,0), c(0,0), c(0, 1))
>

You can attach any transformation you like to a mouse button. See the "mouseCallbacks" demo for R implementations of the standard ones, and modify the mouseTrackball function there to choose the position of the origin of the coordinate system as the centre of rotation.

Duncan Murdoch



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 Mon 25 Apr 2011 - 11:57:37 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 Mon 25 Apr 2011 - 17:10:32 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