POV-Ray : Newsgroups : povray.newusers : Generating animation : Re: Generating animation Server Time
26 Apr 2024 03:49:26 EDT (-0400)
  Re: Generating animation  
From: Bald Eagle
Date: 9 Feb 2023 16:40:00
Message: <web.63e5674023c5f45c1f9dae3025979125@news.povray.org>
"Aj" <nomail@nomail> wrote:
> Hi everyone,
>
> I really appreciate that you take a moment from your important time to resolve
> our issues.
>
> I am trying to animate an oscillating beam and this is what i wrote:

So what you need to do is look at the basic setup for rendering a scene, and
then how to run an animation from an .ini file using the clock variable.

https://wiki.povray.org/content/Documentation:Tutorial_Section_3.7#Making_Animations


> #declare time = 0;

Nope.  POV-Ray uses a variable called "clock" that is a built-in keyword, and
changes when your .pov file is rendered multiple times from the .ini file.

> #declare oscillation = sin(time);

That will probably work if you replace "time" with "clock", or just:
#declare time = clock;
so that you don't have to change any code.

> camera {
>   location <0, 0, 20>
>   look_at <0, 0, 0>
> }
>
> light_source {
>   <10, 10, 20>
>   color rgb <1, 1, 1>
> }
>
> background { color rgb <0.8, 0.9, 1> }
>
> box {
>   <0, -1, 0>, <2, 1, 0.2>
>   texture {
>     pigment { color rgb <0.7, 0.7, 0.7> }
>     finish { ambient 0.2 diffuse 0.8 }
>   }
> }
>
> cylinder {
>   <0, 0, 0>, <0, 0.1+5 * oscillation, 0>, 0.1
>   texture {
>     pigment { color rgb <0.9, 0.2, 0.2> }
>     finish { ambient 0.2 diffuse 0.8 }
>   }
> }
>
> animation {
>   camera {
>     rotation 0
>     location <0, 0, 20>
>     look_at <0, 0, 0>
>   }
>   clip {
>     frames 200
>     fps 30
>     input_file_name "oscillation-#.pov"
>     output_file_name "oscillation-#.png"
>     render_image_size <600, 600>
>     #declare time = clock;
>     #declare oscillation = sin(2*pi*time);
>   }
> }
>
> I get an error in the animation saying it is not a directive. I am using POV-Ray
> 3.7 on windows 10

"it", what is not a directive?

animation isn't a keyword, nor is clip, frames, fps, etc.

Very curious where you got the instructions and those commands from?

Once you write your .pov file, which should render without error all by itself,
then you write an .ini file which is like a script that renders your .pov file
over and over again with an increasing clock variable value.   Then you get a
bunch of still renders that you convert into a video file with some sort of
video processing software / command-line utility, and you have your animation.

I'll let you look all of that over and you can try it out / ask more questions.


- BE


Post a reply to this message

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