More on avatar animations
Hi there,
This is a tough question to explain in text, but I'll try my best: In regards to this this previous post, I attempted to start a timer to freeze an avatar's actions in the middle of an animation -- so the code went something like this: #Perform the action male.act(7) #Start a timer to freeze the avatar after 85% of the action has #been performed viz.starttimer(FREEZE_AVATAR,male.getduration(7) * 0.85) However, I noticed that the timing of the action's duration was not consistent -- each time I ran the script, the avatar would stop at a different point in the animation. Similarly, if I removed the male.getduration(7) * 0.85 parameter and just simply put 1.5 (for 1.5 seconds), 1.5 seconds seemed to be measured differently each time I ran the script. Is there a way to get around this and to get a standardized measure of time? Thanks a lot in advance! |
Hi,
What framerate does your script run at? If your framerate is too low then a lot of time based functions can act rather inconsistently. Also, how inconsistent were the timings? An inconsistency of a frame or so is to be expected. |
Thanks for the reply -- I ran it again and there seems to be no more timing issues.
I have one more question regarding time: We made a script that uses a timer callback function simply displays a running clock in the world (going from 0:00 to 0:01, etc.) and the time runs much faster than realtime. How do we make the running clock run in realtime? Thanks! |
Hi,
Are you running this script on a laptop computer? Vizard uses CPU clockspeed to determine elapsed time, and most laptops have variable CPU speeds in order to save power, which causes inconsistencies in timing. If you aren't using a laptop then I've included a sample script which displays the elapsed time on the screen. Make sure you are doing something similar to this: Code:
import viz |
All times are GMT -7. The time now is 03:17 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC