WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   unlinking view from HMD (https://forum.worldviz.com/showthread.php?t=4935)

smat 01-31-2014 07:28 AM

unlinking view from HMD
 
Hi,

I'm completely new to Vizard, and do also have only limited knowledge about python programming. But I hope you can help me with the following problem.

I use an Oculus HMD together with my virtual environment, and the view-angle within the environment is automatically adapted to the input of the Oculus-gyroscope. So if you wear the HMD and you turn your head, the viewing direction within the virtual environment turns too.

This is realized by the following code:

Code:

hmd = oculus.Rift()
sensor = hmd.getSensor()
viz.link(hmd.getSensor(), viz.MainView)

However, here is the problem: In my scenario, it should be possible to temporarily "unlink" the viewing-angle from the HMD-input. While in some situations in the scenario the user should be able to "look around" and change the viewing angle by moving the HMD, in other situations, looking around should not be possible and the viewing angle should not change when the user moves/turns the HMD (because during this period of time, the viewing angle is passively changed, and should not be alterable by the user). In other words: I am looking for a way to "turn on" (use) and "turn off" (ignore) the oculus input multiple times within my scenario.

Is there any way of "unlinking" the view from the oculus for a limited period of time within the scenario?

Thank you very much in advance!
Best,
Matthias

Frank Verberne 02-01-2014 12:24 AM

Hi Matthias,

You should create a variable for the link, and then you can remove the link. See the code below:
Code:

hmd = oculus.Rift()
sensor = hmd.getSensor()

#To link
viewLink = viz.link(hmd.getSensor(), viz.MainView)

#To unlink:
viewLink.remove()

You should use the unlink code on the appropriate times in your code.

Good luck!
Frank


All times are GMT -7. The time now is 03:36 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC