problem with path animation
Hello!
I want to run a function 4 times. The function entails that the viewpoint is being animated as to look as it is moving through a maze. The problem is that, while it always loads the function 4 times, the animation only works the first time, after which is stops at the position of the end of the animation. It's as if the viewpoint does not get updated back to its initial setting. I would be extremely grateful for any help or pointers, because I tried everything I could think of and it is just trial-and-error! Code:
import viz #Needed to generate a world. |
I noticed that it's not good to have a function with the same name is an object "maze1" so I cahnged the fucntion name to "maze1trial". This, however still has not solved my problem. I wonder why the viewpoint does not reset to the start position, or why the animation does not play again, respectively? I played around with the viewpoint and thought it may be because of the link, so within the trial, at the very end, I am also unlinking, just to be sure. Still did not solve the issue. I would just like the maze objhect to lead and then the viewpoint animation to be played 4 times (as in repeating the animation 4 times, one after the other).
It now looks like this: Code:
import viz #Needed to generate a world. |
I would really appreciate your help! :)
|
Make sure you reset the path at the beginning of each trial:
Code:
pathMaze1.reset() |
Thank you so much, this did the trick and it now works perfectly!!
|
Help again, coordinates not reset
Dear Jeff,
I am sorry, but I am still having problems. To simplify the issue I will explain the first problem I am having, as (once solved) it may solve the others as well. The problem is that once the trial and the animation run once, the other times they run, the coordinates are reset. To find out what happens I added two lines to find out the cooridnates (red below), at those points where I believe I should get the starting and end positions. But the output gives me this: Code:
now I have updated the code below. Code:
import viz #Needed to generate a world. |
All times are GMT -7. The time now is 02:02 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC