View Single Post
  #2  
Old 08-31-2007, 11:47 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Here is some code that will manually apply tracking data to the viewpoint:
Code:
view = viz.get(viz.MAIN_VIEWPOINT)
def mytimer(num):
	data = sensor.get()

	view.translate(data[0],data[1]+1,data[2])
	view.rotate(data[3],data[4],data[5])
	
viz.callback(viz.TIMER_EVENT,mytimer)
viz.starttimer(0,0,viz.FOREVER)
If it still doesn't work, then you might have a problem with your hardware.

If you want to invert the left/right movement then negate the yaw component of the rotation data. So the above rotation command would look like the following:
Code:
view.rotate(-data[3],data[4],data[5])
Reply With Quote