WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-21-2007, 03:59 AM
ghazanfar ghazanfar is offline
Member
 
Join Date: Mar 2007
Posts: 11
Problem with getting duration of walkto()

We are trying to let avatars walk to each other, after that face to each other and wave (say hello).

We have a problem with letting the avatars face to each other, because deciding which angle they have to rotate happens before the agents are done walking.

Does anyone know how to get the duration of walking to a certain point, so we can get the angle to rotate after the walking has finished? Or just letting the program wait until the walking has finished and the continue?

Our current code is the following:

if (ag1=='a1' and ag2=='a3'):
walk_over = male.walkto(meetingpoint[0]+1,meetingpoint[1],meetingpoint[2])
#This line calls that animation.
male.act(walk_over)

#THIS IS WHAT WE HAVE TRIED UNTIL NOW
#male_wave_duration = male.getduration(walk_over)
malepd=male.getduration(5) # THIS WORKS
print "malepd", malepd
#malewd2=male.getduration(walkto)
#print "malewd2", malewd2 # THIS RETURNS AN ERROR
malewd=male.getduration(male.walkto)
print "malewd", malewd # THIS RETURNS AN ERROR
#viz.starttimer(1,malewd )
#print "male_wave_duration", malewd
#wait until walk_over is ready

pos=male.get(viz.POSITION)
pos2=male1.get(viz.POSITION)
rotate_degrees = vizmat.AngleToPoint(pos[0],pos[2],pos2[0],pos2[2])
male.rotate(0,1,0,rotate_degrees)
male.act(5)
walk_over2 = male1.walkto(meetingpoint[0],meetingpoint[1],meetingpoint[2])
male1.act(walk_over2)
pos=male1.get(viz.POSITION)
pos2=male.get(viz.POSITION)
rotate_degrees = vizmat.AngleToPoint(pos[0],pos[2],pos2[0],pos2[2])
male1.rotate(0,1,0,rotate_degrees)
male1.act(5)
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 07:12 AM.


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