I am using a DELL Precision 5820 tower workstation with Windows 11 system. There are three screens connected to the computer, whose resolutions are 25601440,19201080,1920*1080 respectively. I want to open windows with same size but different centers on two small screens. One of the small screen’s screenNumber is 2.
If I type ‘Screen(‘OpenWindow’, 2, 0,[ ]);’ , then the small screen will open a black window as expected.
However if I type ‘Screen(‘OpenWindow’, 2, 0, [50,50,860,720]);’, the black window will appear on the big screen.
It is strange that after adding the [,rect], the window does not appear on the screen with screenNumber that I want. How can I create two specified window on screen2 and screen3 with different physical centers?
Rect positions are not relative to the monitor specified but in a global coordinate system shared across monitors. Use Screen(‘Rect’) to get the global rect of each monitor, and use CenterRect to place your window rect in it
@dcnieho is sort of correct. That’s how it is done on Windows and macOS. On Linux, by design of the X-Windows display system, the origin is per X-Screen aka PTB screen, as each X-Screen is its own separate universe, so on a single-X-Screen setup this is the same as on Windows, but on multi-X-Screen it isn’t.
Always remember though that opening non-fullscreen windows will ruin any reliable visual stimulus timing/timestamping on Windows and macOS. Even on Linux you could only get trustworthy timing when running under GNOME or Ubuntu desktop GUI with some special opt-in option enabled, and reduced performance and some other restrictions. So for experiments where visual timing matters, non-fullscreen is often a no-go on Linux, and always a no-go on Windows and macOS. The same is true for partially transparent fullscreen windows.
The question is what it is you want to achieve here with those windows with different centers?
Thanks a lot!
I just realized this problem!
Yes, thanks very much for your precious advice!
I am just doing some pre-test on a windows workstation, which does not require precise time control. We have a stereoscope system with two split monitors which present stimuli through reflection of mirror. It seems the centers of monitors are unavoidably different in two eyes. So I did a calibration first to fix this, ensuring that the windows on two monitor has same center in each eye’s view.
Normally you’d use PsychImaging('Openwindow', ...)
with stereomode 4 or 5 for this and the adjust specific placement, scaling etc. via SetStereoSideBySideParameters()
, cfe. ImagingStereoDemo(4);
.
This also allows then to use per eye view PsychImaging
tasks to do things like flip stimuli horizontally or vertically (tasks ‘FlipHorizontal’ and ‘FlipVertical’), use display distortion correction (cfe. help DisplayUndistortionBVL
) etc., to deal with mirrors and such, if needed.
Either you’d display to a single ptb screen 1,2,… and use some hardware display splitter to split to two monitors, or use a single wide-screen monitor for your stereoscope, or you’d assign the two stereoscope monitors to ptb screen 1 and 2, then select screen 0 for display (which combines screen 1+2) - and hope that the latest Windows OS bugs won’t cause mayhem, as they did in some Windows releases with some graphics cards, or use Linux instead.