[R] rgl: How to position a window during open3d call

Koen Stegen koen.stegen at oma.be
Wed Sep 17 19:13:15 CEST 2008


Dear all,

The documentation on the function open3d in the rgl package, reads:

    open3d opens a new rgl device, and sets the parameters as requested.

I want the new rgl device (window) to be sized and positioned in a specific
place on my screen. So, I try to set the "windowRect" parameter as follows:

    > library("rgl")
    > open3d(windowRect=c(100,100,500,500))
    [1] 1

Obviously you can't see where the window appears, so I'll ask for the
"windowRect" parameter:

    > par3d()["windowRect"]
    $windowRect
    [1] 2300  764 2556 1020

As you can see, the window is not positioned at (100,100) nor is the size
400x400. The size is the default 256x256 and the position is where the window
manager would put a new window if its position is unspecified.
[note: I have a dual screen setup so the coordinates are not bogus]

If, however, I use par3d to set the "windowRect", the window goes where it is
supposed to go:

    > par3d(windowRect=c(100,100,500,500))
    > par3d()["windowRect"]
    $windowRect
    [1] 104 125 504 525

The (4,25) pixels offset are the border and title bar of the window.

For completeness sake:
This behavior occurs on both Windows+ATI, Linux+ATI, Linux+NVidia.
On Windows  is R version 2.7.2, and rgl version 0.81 (installed today).

Does anyone know how to set the windowRect parameter during an open3d call?


Thanks in advance,

Koen Stegen
Royal Meteorological Institute of Belgium



More information about the R-help mailing list