PDA

View Full Version : monocular rendering in HMD


dcnieho
06-09-2016, 08:22 AM
Hi Guys,

Is there an easy way to only render to one of the eyes in an HMD, presenting black/nothing to the other? HMDs in question are the Rift DK2 and the HTC Vive (in case solutions are specific to the HMD). If that's not easily possible, I'll just look at getting an eye-patch, no worries.

Thanks!

Jeff
06-09-2016, 11:44 PM
You could render a quad over just one eye:

fadeQuad = viz.addTexQuad(pos=[0,0,0.1],scale=[5000,5000,1])
fadeQuad.setReferenceFrame(viz.RF_VIEW)
fadeQuad.renderToEye(viz.LEFT_EYE)
fadeQuad.color(viz.BLACK)
fadeQuad.drawOrder(100)

dcnieho
06-13-2016, 07:01 AM
Thanks! In my case the scene is real simple, renderToEye() to hide the objects i only want to see in one eye is even simpler. Nice!

Jeff
06-20-2016, 11:29 PM
Rather than using a quad to hide the scene like I posted earlier, an easier solution is to set one eye to an empty scene:

import viz
import vizact
viz.go(viz.STEREO_HORZ)

viz.addChild('piazza.osgb')

#Show or hide scene 1 for the right eye
vizact.onkeydown('1',viz.MainWindow.setScene,1,eye =viz.RIGHT_EYE)
vizact.onkeydown('2',viz.MainWindow.setScene,2,eye =viz.RIGHT_EYE)