View Single Post
  #5  
Old 08-27-2021, 12:24 PM
sado_rabaudi sado_rabaudi is offline
WorldViz Team Member
 
Join Date: Jul 2016
Posts: 26
One way to do this is to first create a group tracker in vizconnect that will contain the modified tracking data without roll. Next, in the avatar animator set the avatar head to move with this group tracker. Then in a callback function, which could be in the postInit or the application script, set the group tracker's position,yaw, and pitch using data coming from the Oculus tracker. Here's an example function:

def postInit():
"""Add any code here which should be called after all of the initialization of this configuration is complete.
Returned values can be obtained by calling getPostInitResult for this file's vizconnect.Configuration instance."""

Group tracker need to be added to vizconnect and used in animator
groupTracker = vizconnect.getRawTracker('headTrackerGroup')
steamHeadTracker = vizconnect.getRawTracker('head_tracker')

def onUpdate():
pos = oculusHeadTracker.getPosition(viz.ABS_GLOBAL)
ori = oculusHeadTracker.getEuler(viz.ABS_GLOBAL)

Set roll to 0
ori = [ori[0], ori[1], 0]
groupTracker.setPosition(pos, viz.ABS_GLOBAL)
groupTracker.setEuler(ori, viz.ABS_GLOBAL)

vizact.onupdate(vizconnect.PRIORITY_ANIMATOR+1, onUpdate)

return None
Reply With Quote