#1
|
|||
|
|||
Change rotational gain on HMD
Hello,
I'm currently attempting to create a Psychology undergraduate experiment using Vizard and an Oculus Rift HMD. I'm very inexperienced with Python, so apologies if I don't explain myself properly. I'd like to be able to manipulate the rotational gain of the HMD. For example, if a person were to move their head 45 degrees to the right, I'd like to be able to apply a multiplier (e.g. 2) and have the virtual environment appear to move 90 degrees to the left. I'm only interested in manipulating the yaw movements of the head, but if it has to be applied to pitch and roll movements as well then that will also work. I've currently connected the Oculus tracker and display through vizconnect. I understand this goes against best practices for VR development, but I'm testing whether certain participants will be able to detect these changes. Is this possible? Many thanks, Alex |
#2
|
|||
|
|||
You can apply a scale operator on the tracker link:
Code:
trackerLink = vizconnect.getTracker('head_tracker').getLink() trackerLink.scaleEuler([2,1,1],viz.LINK_ORI_OP) |
#3
|
|||
|
|||
This works perfectly. Thanks a lot for your help
Alex |
#4
|
|||
|
|||
Staircase Rotational Gain
Hi
I was wondering if anyone knows how to change rotational gain in a stair case (basically make the gain go up or down depending on whether someone can state whether the gain is normal or not). Ideally, I want to get to the point where a person states that at a certain degree they believe the world to be moving correctly. Thank you - and apologies if I have made myself unclear I am new to Vizard. |
#5
|
|||
|
|||
Sorry, I don't understand. Do you want to change the rotational gain of the tracker only when moving on the staircase? What hardware are you using?
|
#6
|
|||
|
|||
Hi Jeff,
Apologises, I did not make myself clear. I want to change the rotational gain based on the response an individual gives. So that the responses go up and down (like a staircase) in order to find a point at which they cannot notice the gain has been changed. The problem I am currently having is that the scale euler seems to multiply the gain based on the previous gain value. Is there a way that I can set it back to 'norma'l before I then move to the next value. For example if I have a gain of [1.3,1,1] and I then want it to be [0.9,1,1] is there a way to get to 0.9 with multiplying 1.3 by 0.9? Ideally, the gain will be [1.3,1,1] then reset to [1,1,1] before [0.9,1,1] is applied. Is this possible? Thank you! |
#7
|
|||
|
|||
You can apply a reset to the link and remove the operator previously assigned before applying a new one:
Code:
trackerLink.reset(viz.RESET_OPERATORS) Code:
rawTracker = vizconnect.getTracker('head_tracker').getRaw() trackerLink = vizconnect.getTracker('head_tracker').getLink() trackerLink.scaleEuler([2,1,1],viz.LINK_ORI_OP) def removeScaleFactor(): yaw_link = trackerLink.getEuler()[0] yaw_raw = rawTracker.getEuler()[0] yaw_diff = yaw_link - yaw_raw trackerLink.reset(viz.RESET_OPERATORS) trackerLink.postEuler([yaw_diff,0,0],viz.LINK_ORI_OP) vizact.onkeydown('1',removeScaleFactor) |
#8
|
|||
|
|||
Hi,
Thank you so much for this. This worked for me. However, I am now trying to do a similar experiment where I change the 'gain' when moving forwards and back wards. Do you know if there is a similar function to the 'scale Euler' function which would allow gain manipulations when translating forward and backwards? Basically, I would like the user to move forward by, say one step, and ask them if they think the world moved like it normally would or if it moved further away/closer. Thank you! Ryan |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Change Viewpoint in different scenes | lilio | Vizard | 1 | 08-28-2009 02:56 PM |
Change model alpha and memory leak | hosier | Vizard | 2 | 06-25-2009 10:55 AM |
changing the gain of a joystick during a program | Saz | Vizard | 4 | 06-25-2009 03:49 AM |
How can you dynamically change the gain on a tracker-based CaveView? | michaelrepucci | Vizard | 2 | 09-23-2008 07:18 AM |
Randomly and Continuously Change Avatar's Face Texture | Karla | Vizard | 4 | 08-22-2008 12:14 PM |