[R] Defining origin for rotation in RGL device

Duncan Murdoch murdoch.duncan at gmail.com
Mon Apr 25 13:54:58 CEST 2011


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



More information about the R-help mailing list