View Single Post
  #7  
Old 06-13-2013, 11:33 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You want the position/pitch/roll of the box based on the viewpoint and the yaw of the box based on the sensor, correct?

If that's the case you could manually update the box orientation every frame in a function registered with vizact.onupdate:
Code:
import viz
import vizact
viz.go()

box = viz.add('box.wrl', pos=[0,0,0])
plan = viz.add('tut_ground.wrl')

mySensor = viz.add( 'testtrack_all.dls' )

link = viz.link(viz.MainView, box, mask=viz.LINK_POS)
link.postTrans([0,0,6])

def updateOri():
	yaw = mySensor.getEuler()[0]
	pitch = viz.MainView.getEuler()[1]
	roll = viz.MainView.getEuler()[2]
	box.setEuler([yaw,pitch,roll])
	
vizact.onupdate(0,updateOri)
Reply With Quote