WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-30-2011, 04:20 AM
Veronika Veronika is offline
Member
 
Join Date: Jan 2010
Posts: 22
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
Reply With Quote
  #2  
Old 09-30-2011, 08:10 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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.
Reply With Quote
  #3  
Old 10-03-2011, 01:16 AM
Veronika Veronika is offline
Member
 
Join Date: Jan 2010
Posts: 22
yes, I need only this. But how I can pull out those values from track data and apply them to the avatar?
Reply With Quote
  #4  
Old 10-04-2011, 04:01 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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)
Reply With Quote
  #5  
Old 10-05-2011, 07:06 AM
Veronika Veronika is offline
Member
 
Join Date: Jan 2010
Posts: 22
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?
Reply With Quote
  #6  
Old 10-05-2011, 12:59 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Try removing the line where the avatar is linked to the Patriot data. That link is overriding the update function.
Reply With Quote
  #7  
Old 10-07-2011, 01:33 AM
Veronika Veronika is offline
Member
 
Join Date: Jan 2010
Posts: 22
it's function thank you very much
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Avatar walking + camera free look kovitch Vizard 2 08-08-2011 08:57 AM
avatar walking over a sequence of points IGoudt Vizard 1 10-16-2009 12:22 PM
avatar automatically runs animation after fading into view v-clizzin Vizard 1 10-14-2009 06:01 PM
Looking through the eyes of an avatar Frank Verberne Vizard 2 04-01-2008 06:52 AM
How to make avatar's eyes to blink when speaking michelcm3 Vizard 12 01-15-2008 09:48 AM


All times are GMT -7. The time now is 12:46 PM.


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