PDA

View Full Version : Temporarily cease Oculus DK2 rendering or hide display


willpower2727
06-08-2016, 08:30 AM
I'm wondering if there is a way to momentarily stop rendering on the Oculus DK2? I'm looking to do something analogous to:


viz.setOption('viz.window.visible', 0)


I've tried this with my current setup and it hides the mirrored window on my PC's monitor but it does nothing to the rendering on the Oculus itself. Here is the code I use to setup the DK2:


import oculus

hmd = oculus.Rift()
if not hmd.getSensor():
sys.exit('Oculus Rift not detected')
else:
profile = hmd.getProfile()
hmd.setIPD(profile.ipd)


# Setup navigation node and link to main view
global navigationNode
navigationNode = viz.addGroup()
global viewLink
viewLink = viz.link(navigationNode, viz.MainView)


Any ideas or methods I can use to hide/stop rendering on the DK2 without stopping the whole program?

Jeff
06-09-2016, 04:53 AM
Does the following work?

viz.setOption('viz.window.visible', 0)
viz.MainWindow.visible(False)
hmd.remove()

Would rendering a quad over the scene to hide it work for you?

willpower2727
06-10-2016, 08:23 AM
None of the options stop rendering or hide it or whatever on the hmd.


viz.MainWindow.visible(False)


Works at hiding the mirrored window on my PC's monitor but the scene is still being rendered on the HMD. Interestingly hmd.remove()
Doesn't seem to do anything.

I will have difficulty in hiding the scene with a quad since the user is immersed in the scene (subject can walk around and interact with the scene). In order to hide the scene with a quad I'd have to have reliable information about the head position and orientation which in the scenarios where I want to hide things, this data is inaccurate.

Alternatively I think I'll try positioning a black sphere around the head when I want to hide the scene, so that only the position data needs to be robust.

dcnieho
06-13-2016, 07:00 AM
You can use parent=viz.SCREEN to have an object in screen based coordinates instead of int eh virtual world. works with vizshape at least.

willpower2727
06-15-2016, 07:40 AM
@dcnieho, that's a great idea, it works great and you were right I don't have to worry about setting the position.


global HideSphere
HideSphere = vizshape.addQuad(size=[1,1])
HideSphere.setParent(viz.SCREEN)
HideSphere.setPosition(0.5,0.5,0)
HideSphere.color(0,0,0)

dcnieho
09-07-2016, 08:39 AM
Hi Jeff,

I wanted to note that the below:

None of the options stop rendering or hide it or whatever on the hmd.


viz.MainWindow.visible(False)


Works at hiding the mirrored window on my PC's monitor but the scene is still being rendered on the HMD.

Is also a symptom of not having access to the screen on the HMD through vizard. It could well be the same underlying problem as getting resolution of HMD, etc. all viz.MainWindow operations are for the window on the desktop, not the HMD screen.