![]() |
|
#1
|
|||
|
|||
|
move with avatar and patriot
Hello, I have script:
Code:
#add avatar
avatar=viz.add('male.cfg')
avatar.state(2)
#Connect to Patriot sensor
polhemus = viz.add('polhemus.dle')
patriot = polhemus.addPatriot()
#set the move and speed
import vizmat
def updateAvatar():
pos=patriot.getPosition()
ori=patriot.getEuler()
p1 = [0,0,0]
p2 = [pos[0],0,pos[0]]
distance = vizmat.Distance(p1,p2)
if distance <= 0.1:
speedFactor = 4
elif distance > 0.1 and distance <= 0.8:
speedFactor = 7
else:
speedFactor = 9
avatar.setPosition([pos[0]*speedFactor,0,pos[0]*speedFactor])
avatar.setEuler([ori[0],0,0])
vizact.onupdate(0,updateAvatar)
could you help with this? Thanks Veronika |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| walking of avatar via patriot | Veronika | Vizard | 6 | 10-07-2011 01:33 AM |