;-) Tracking cheat
Hi
Just to know for sure if it works...
Could you help me with a snippet just to send the tracking data to the simulation computer ?
Just a snippet with the networking demo that works
#Add a room.
court = viz.add('court.ive')
#Add an avatar for your friend.
other = viz.add('vcc_male.cfg')
############# Add networking ####################
#Name your opponent.
OTHER_COMPUTER = 'vistameuk'
#Add a network for sending data to your other computer.
other_net = viz.addNetwork( OTHER_COMPUTER )
#Send mailox.
def send_box():
#Send the position of the
#cueball to the master.
pos = viz.MainView.getPosition()
ori = viz.MainView.getEuler()
other_net.send( other_pos = pos, other_ori = ori )
#Send the data to the master as frequently as possible.
vizact.ontimer(0, send_box )
#Add a network to listen to the data.
def onNetwork(e):
global current_animation
#This function will handle network
#events.
if e.sender == OTHER_COMPUTER:
#Set the position of the other in your world.
other.setPosition( e.other_pos )
other.setEuler( e.other_ori )
#other.state( e.current_animation )
viz.callback(viz.NETWORK_EVENT,onNetwork)
def onKeyDown(key):
global current_animation
current_animation = eval( key )
viz.callback(viz.KEYDOWN_EVENT,onKeyDown)
So if you start the let's say tracker listener you need to invoke tracking on that machine and send the data to the mainview
While I am not just to send tracking data help would be nice
Thanks
|