WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-24-2009, 02:08 AM
Moh200jo Moh200jo is offline
Member
 
Join Date: Feb 2009
Posts: 99
Walking Function

Hi guys
Are there any examples for walking to specific targets?
For example: the targets are 4 boxes; the avatar should walk to reach them and then stop for 1s in front box (4 stops).
I used viz.move (x, y, z, speed, target distance)
But the problem is in target distance; If targets are as follows:
10, 20, 30, 40 all theses distances are measure from 0 point and move function measures this from 0 point; the avatar can do just the first target correctly.
Any ideas for this?
Alternatively, is there function can do this?
Thanks
Reply With Quote
  #2  
Old 02-24-2009, 04:00 AM
Moh200jo Moh200jo is offline
Member
 
Join Date: Feb 2009
Posts: 99
this is a sample :
Code:
import viz
viz.go()

room=viz.add('court.ive')
box = viz.add('box.wrl')
room.setPosition(0,0,25)

boxes=[]
for i in [15,30]:
	box = viz.add('box.wrl')
	box.setPosition(0,1,i)
	boxes.append( box )
avatar=viz.add('vcc_male.cfg')
avatar.setPosition(0,0,3)
i=0
def keyboard(key):
	if key=='w':
		boxtar=boxes[i]
		target=boxtar.getPosition()[2]
		avatar.state(2)
		walk=vizact.move(0,0,1,target-3)
		avatar.addAction(walk)
		global i
		i+=1
viz.callback(viz.KEYBOARD_EVENT,keyboard)
Reply With Quote
  #3  
Old 02-24-2009, 10:07 AM
Moh200jo Moh200jo is offline
Member
 
Join Date: Feb 2009
Posts: 99
speed and distance

I found the problem and it is that the avatar position times the speed; for example : if the box position is 2 and the avatar starts from 0 with speed 2 his position will be at 4 not 2 although the order like this viz.move(0,0,2,2)
Are there any thoughts?
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
Documentating function names aaThomas Vizard 5 05-15-2007 09:50 AM
Do you know how to send a value for 'pool' to the onActionEnd function? ghazanfar Vizard 1 03-22-2007 10:25 AM
timers and director function Jerry Vizard 1 06-22-2006 09:47 AM
Walking avatars --> collision detection? sjroorda Vizard 3 10-13-2005 04:47 AM
node3d.center function tavaksai Vizard 3 08-13-2004 11:05 AM


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


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