View Single Post
  #2  
Old 10-31-2016, 11:38 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
It sounds like you maybe looking for the yaw component of the euler angle. The following example shows the yaw, pitch, and roll values every frame:

Code:
import viz
import vizact
import vizinfo

viz.go()

info = vizinfo.InfoPanel('Head Ori Data')
yaw = info.addLabelItem('yaw',viz.addText(''))
pitch = info.addLabelItem('pitch',viz.addText(''))
roll = info.addLabelItem('roll',viz.addText(''))

viz.add('dojo.osgb')

def updateInfo():
	ori = viz.MainView.getEuler()
	yaw.message('{:.2f}'.format(ori[0]))
	pitch.message('{:.2f}'.format(ori[1]))
	roll.message('{:.2f}'.format(ori[2]))

vizact.onupdate(0,updateInfo)

Last edited by Jeff; 10-31-2016 at 11:43 AM.
Reply With Quote