View Single Post
  #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