WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 10-11-2011, 04:50 AM
Veronika Veronika is offline
Join Date: Jan 2010
Posts: 22


I want to walk with avatar via patriot. I need to walking in the big room. but patriot has only small range of source - up to 5 feet (1.52 meters). I need to set, if the patriot sensor is on the calibration place, the speed of avatar is 0. and if the sensor is moving in some direction, the avatar is moving in the same direction. I have set it. but I don't know, if the sensor is near to the calibration place, the speed of avatar is small, and if the sensor is further from this place, the speed is more. Is possible it to set?

Reply With Quote
Old 10-11-2011, 05:52 PM
Jeff Jeff is offline
WorldViz Team Member
Join Date: Aug 2008
Posts: 2,465
If you are using the code from your previous thread you could multiply the position of the sensor by some factor based on it's distance from the source:
import vizmat
def updateAvatar():
	distance = vizmat.Distance([0,0,0],[pos[0],0,pos[2]])
	if distance <= 0.5:
		speedFactor = 1
	elif distance > 0.5 and distance <= 1:
		speedFactor = 1.25
		speedFactor = 1.5
Reply With Quote
Old 10-12-2011, 12:30 AM
Veronika Veronika is offline
Join Date: Jan 2010
Posts: 22
it's perfect code. thank you very much
Reply With Quote

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

All times are GMT -7. The time now is 03:36 PM.

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