POV-Ray : Newsgroups : povray.newusers : animation to change size : Re: animation to change size Server Time
29 Jul 2024 22:22:42 EDT (-0400)
  Re: animation to change size  
From: Slime
Date: 25 Jan 2005 22:16:21
Message: <41f70b85$1@news.povray.org>
> Say I have a sphere, how could I generate 10 rendered images with the size
> increasing by X percent per frame?


Well, it might be easier to make it go from one size to another size over
the course of the animation, rather than a per-frame kind of thing. This can
be done with the clock variable:

#declare startsize = 2;
#declare endsize = 5;
sphere {
    <0,0,0>, startsize + clock*(endsize - startsize)
    // goes from 2 to 5 as clock goes from 0 to 1
    ...
}

And rendered with +KFI0 +KFF9 to render frames 0 through 9 (total of 10).
The clock will increase from 0 to 1 over the course of these frames.

Now, if for some reason it's really important that you do this in the
"X-percent-per-frame" way, then that can be done as so:

#declare X = 5/100; // 5%
sphere {
    <0,0,0>, 2 * pow(1 + X, frame_number)
    ...
}

But I don't recommend this, mostly because it links the behavior of the
animation to the number of frames. It's good to be able to increase your
framerate without altering the animation itself.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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