View Single Post
  #2  
Old 03-15-2013, 06:49 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,454
You could try something like the following:
Code:
import viz
import vizact
import vizcam

viz.go()

DELAY = 2
dojo = viz.add('dojo.osgb')
walkNav = vizcam.addWalkNavigate()

recordedData = []
def RecordTrackingData():
	recordedData.append( (walkNav.getPosition(), walkNav.getQuat()) )
vizact.onupdate(0,RecordTrackingData)

def ApplyTrackingData():
	pos,ori = recordedData.pop(0)
	viz.MainView.setPosition([pos[0],1.8,pos[2]])
	viz.MainView.setQuat(ori)
	
ApplyDataCallback = vizact.onupdate(0,ApplyTrackingData)
ApplyDataCallback.setEnabled(viz.OFF)

vizact.ontimer2(DELAY,0,ApplyDataCallback.setEnabled,viz.ON)
Reply With Quote