WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   walking of avatar via patriot (https://forum.worldviz.com/showthread.php?t=3932)

Veronika 09-30-2011 03:20 AM

walking of avatar via patriot
 
Hi,

I want to set the avatar and sensor, that the sensor is on the place, when the calibration was, in the virtual place the avatar stands too and subsequently, into which the direction the sensor is moving, so in the virtual world avatar is moving in the same direction. But my avatar is always rotated around all axis. I use patriot. can you help me with this?

thanks

Jeff 09-30-2011 07:10 PM

Do you want the avatar to only move X-Z for position and yaw for orientation? If so, you'll have to pull out just those values from the tracker data and apply them to the avatar's position and orientation.

Veronika 10-03-2011 12:16 AM

yes, I need only this. But how I can pull out those values from track data and apply them to the avatar?

Jeff 10-04-2011 03:01 PM

Within a function that gets called every frame you can get the tracker data as lists and extract the values you want to use. Something like the following:
Code:

def updateAvatar():
        pos=tracker.getPosition()
        ori=tracker.getEuler()
        avatar.setPosition([pos[0],0,pos[2]])
        avatar.setEuler([ori[0],0,0])
       
vizact.onupdate(0,updateAvatar)


Veronika 10-05-2011 06:06 AM

I have this code:
Quote:

import viz

viz.go()

#set main view (x,z,y)
viz.MainView.translate(0,2,-15)
viz.clearcolor(viz.GRAY)

#Connect to Patriot sensor
polhemus = viz.add('polhemus.dle')
patriot = polhemus.addPatriot()


avatar=viz.add('male.cfg')

#Link the hand to the Patriot data
viz.link(patriot,avatar)

def updateavatar():
pos=patriot.getPosition()
ori=patriot.getEuler()
avatar.setPosition([pos[0],0,pos[0]])
avatar.setEuler([ori[0],0,0])

vizact.onupdate(0,updateavatar)
and I want to walk with avatar and if sensor is further from calibration place, the speed of walking is more. But this code for update avatar isn't function. I whole day try to set this, but I don't know how. Can you help me with this?

Jeff 10-05-2011 11:59 AM

Try removing the line where the avatar is linked to the Patriot data. That link is overriding the update function.

Veronika 10-07-2011 12:33 AM

it's function :) thank you very much :)


All times are GMT -7. The time now is 05:30 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC