WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-27-2012, 12:55 AM
Veronika Veronika is offline
Member
 
Join Date: Jan 2010
Posts: 22
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)
But when I move with sensor of Patriot, avatar is moving only in one line, no anywhere in axis x and y.
could you help with this?

Thanks
Veronika
Reply With Quote
  #2  
Old 02-28-2012, 03:23 AM
Veronika Veronika is offline
Member
 
Join Date: Jan 2010
Posts: 22
I found a mistake now it's ok
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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
walking of avatar via patriot Veronika Vizard 6 10-07-2011 12:33 AM


All times are GMT -7. The time now is 11:56 PM.


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