WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-06-2017, 08:17 AM
Alex Alex is offline
Member
 
Join Date: Feb 2017
Posts: 2
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
Reply With Quote
  #2  
Old 02-06-2017, 02:45 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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)
Reply With Quote
  #3  
Old 02-09-2017, 05:15 AM
Alex Alex is offline
Member
 
Join Date: Feb 2017
Posts: 2
This works perfectly. Thanks a lot for your help

Alex
Reply With Quote
  #4  
Old 11-13-2017, 10:03 AM
ryang1006 ryang1006 is offline
Member
 
Join Date: Nov 2017
Posts: 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.
Reply With Quote
  #5  
Old 11-14-2017, 10:32 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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?
Reply With Quote
  #6  
Old 01-31-2018, 01:42 AM
ryang1006 ryang1006 is offline
Member
 
Join Date: Nov 2017
Posts: 4
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!
Reply With Quote
  #7  
Old 02-04-2018, 10:24 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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)
Will the scale be changing as the participant is moving or only between trials? If while moving then it will also be necessary to apply an orientation offset to account for the difference between the scaled orientation value and the raw orientation value. For example the following code adds an offset so the view does not jump when the scale factor is removed:

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)
The postEuler offset would change each time the scale factor changes.
Reply With Quote
  #8  
Old 06-02-2018, 06:58 AM
ryang1006 ryang1006 is offline
Member
 
Join Date: Nov 2017
Posts: 4
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
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -7. The time now is 07:16 AM.


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