Change Screen rendering origin to screen center, instead of upper left corner

tl;dr

Is there any way to reconfigure the default origin of Screen to be at screen center with a non-inverted y-axis? (…perhaps a magic kPsychSomethingSomething flag during ‘OpenScreen’ )


I’ve been wrestling with rendering stimuli using a combination of straightforward PTB 2D drawing methods (i.e. Screen(‘DrawDots’…), Screen(‘DrawTextures’…), etc) & native 3D OpenGL methods (a la moglDrawDots3d.m).

I keep bumping into discrepancies between rendering coordinate systems, where the standard pixel-centric rendering in PTB places the origin at the upper left corner of the screen with an inverted y-axis (+y is downward), while rendering in 3D OpenGL is setup with the origin at [0, 0, viewingDistance] and a normal y-axis (+y is upward; upvect == [0 1 0]).

Since [my] research is moving beyond a rasterized screen-centric frame of mind, toward a more natural representation of real-world visual information, I’d like to wrangle the PTB coordinate system into alignment with 3D OpenGL, rather than the other way around.

Digging deep into the source code, it looks like PTB’s 2D coordinate system is setup in:
PsychWindowSupport.c > PsychSetupView
gluOrtho2D(rect[kPsychLeft], rect[kPsychRight], rect[kPsychBottom], rect[kPsychTop]);

I’d essentially like to just override that projection matrix to something like:
gluOrtho2d( -width/2, width/2, -height/2, height/2 );

Is there an existing mechanism to implement an updated projection matrix for PTB’s standard 2D rendering pipeline?