View Single Post
  #4  
Old 06-02-2015, 02:49 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,465
Here's an example using a keyboard tracker.

Server Code:

Code:
'''
Press the wasd keys to move the tracker
'''

import viz
import vizcam
import vizinfo
import vizact
viz.go()

vizinfo.InfoPanel()

vrpn = viz.add('vrpn7.dle')
server = vrpn.addTrackerServer('VizardTracker')
tracker = vizcam.addKeyboardPos()
server.setTracker(tracker)

def printData():
	print tracker.getPosition()
	
vizact.onupdate(0,printData)
Client Code:

Code:
'''
Press the wasd keys in the server window to 
move the axes model here in the client
'''

import viz
import vizshape
import vizinfo

viz.go()

vizinfo.InfoPanel()

viz.move([0,0,-6])
viz.addChild('sky_day.osgb')
axes = vizshape.addAxes()

vrpn = viz.add('vrpn7.dle') 
tracker = vrpn.addTracker('VizardTracker@localhost')
viz.link(tracker,axes)
Reply With Quote