POV-Ray : Newsgroups : povray.animations : Animation block...acceleration on the x axis. : Re: Animation block...acceleration on the x axis. Server Time
27 Apr 2024 06:32:09 EDT (-0400)
  Re: Animation block...acceleration on the x axis.  
From: clipka
Date: 23 Feb 2009 17:00:01
Message: <web.49a31c0321b0f15abc3331700@news.povray.org>
"RC" <nomail@nomail> wrote:
> I know this question is going to be a head slapper but I can't seem to get an
> object to increase in speed. I need this object to increase in speed every x
> clock cycles, so I'm using an if statement. Problem is I can get it to enter
> the 'else' section, but it never returns to my original condition after I reset
> my variable counting to x (num).

Unless I got you wrong, the head slapper is probably the fact that animations
aren't run in a loop as you seem to expect. Instead, the whole SDL is restarted
for each frame, with different values for clock and frame number.

To pass values from one frame to the next, you need to #write them to a file. Or
re-compute everything from the frame number. For example, you could change your
code to:

#declare elapsedClock = 0;
#while (elapsedClock < clock)

  //... re-compute what you did in those previous frames...

  #declare elapsedClock = elapsedClock + (clocksPerFrame)
#end


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.