Does anyone have sample code demonstrating a functional stereoscopic 3D display?
This is what I’ve tried:
from psychopy import visual, core
win = visual.Window([2560,1440], fullscr=True, monitor="testMonitor", units="deg", stereo=True)
hello = visual.TextStim(win=win, text='Hello')
world = visual.TextStim(win=win, text='World')
while True:
win.setBuffer('left')
hello.draw()
win.setBuffer('right')
world.draw()
win.flip()
But it doesn’t work. No combination of buffer clearing or flipping between left/right renders generates 3D. As far as I can tell, the display doesn’t actually switch to stereoscopic mode, since the 3D Vision emitter on my PC doesn’t come on.
FWIW, this sample does work properly:
import sys
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
import time
def display():
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_ACCUM_BUFFER_BIT)
glDrawBuffer(GL_BACK_LEFT)
glClearColor(1.0, 0.0, 0.0, 1.0) # red
glClear(GL_COLOR_BUFFER_BIT)
glDrawBuffer(GL_BACK_RIGHT)
glClearColor(0.0, 0.0, 1.0, 1.0) # blue
glClear(GL_COLOR_BUFFER_BIT)
glutSwapBuffers()
def idle():
glutPostRedisplay()
if __name__ == '__main__':
glutInit(len(sys.argv), sys.argv)
glutInitDisplayMode(GLUT_RGB | GLUT_STEREO | GLUT_DOUBLE)
glutGameModeString("2560x1440:32@120")
glutEnterGameMode()
glutDisplayFunc(display)
glutIdleFunc(idle)
glutMainLoop()
Am I missing something simple? Does anyone have a working stereoscopic demo they can share?