POV-Ray : Newsgroups : povray.newusers : Generating animation Server Time
2 Mar 2024 14:41:00 EST (-0500)
  Generating animation (Message 1 to 8 of 8)  
From: Aj
Subject: Generating animation
Date: 9 Feb 2023 16:20:00
Message: <web.63e5624cb2eea043acf42d723d902b29@news.povray.org>
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:

#declare time = 0;

#declare oscillation = sin(time);

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

Any suggestion would be really helpful


Post a reply to this message

From: Bald Eagle
Subject: Re: Generating animation
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

From: yesbird
Subject: Re: Generating animation
Date: 9 Feb 2023 16:50:00
Message: <web.63e56a1a23c5f45c7eb01f2810800fb2@news.povray.org>
"Aj" <nomail@nomail> wrote:

Hi,Aj.

I am new to POV'a animation techniques, but quick googling make me think that
POV is right in this case: there is no 'animation' no 'clip' keywords in this
list:
https://wiki.povray.org/content/Reference:Keywords

When I am following this section, everything works fine:
https://wiki.povray.org/content/HowTo:Create_animations#Animating_objects

All the best,
--
YB


Post a reply to this message

From: Kenneth
Subject: Re: Generating animation
Date: 10 Feb 2023 08:50:00
Message: <web.63e64a6923c5f45c9b4924336e066e29@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
>
> 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.
>

Hi, Aj! Welcome to the crazy world of POV-ray animation. ;-) It is actually
easier to accomplish than what you might think.

In addition to Bald Eagle's good comments, here's a quick explanation of what is
meant by the 'ini.file'.

In Windows, there is an included file called 'quickres.ini.' It holds a lot of
pre-written render resolutions for you. But it's also the place where I put all
of my animation commands-- like Start_Frame, Final_Frame, etc. There, you would
simply write
           Final_Frame=100  (no spaces)

This will automatically turn on the animation mechanism, ready and waiting.

And in your scene file, you would use the 'clock' keyword to create movement (or
'frame_number' if you want to actuate your animation that way instead.) Like,

object{ // optional
    sphere{<0,0,0>, 1 texture{...} translate 12*clock*x}
      }

Then hit the usual 'Run' command button, and POV-ray will automatically create
100 animation-frame renders, with the sphere moving 12 units in the +x
direction. That's your animation! -- ready to be assembled in your external
video-processing app.

For the many useful animation commands for doing things, take a look in v3.7's
included(?) 'help' file at the section called
          2.3.9 Making Animations

or just look up 'clock' or 'Final_Frame'. That should put you in the right place
in the documentation.

(I happen to be running a newer 3.8 version of POV-ray, so my help file may not
be exactly the same as yours.)


Post a reply to this message

From: Kenneth
Subject: Re: Generating animation
Date: 10 Feb 2023 09:00:00
Message: <web.63e64cd323c5f45c9b4924336e066e29@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
>
> And in your scene file, you would use the 'clock' keyword to create movement...

I forgot to mention that, by default, 'clock' always increments from 0.0 to 1.0,
no matter how many animation frames you render.  Its behavior can be changed, of
course-- but leave that for another day ;-)


Post a reply to this message

From: Bald Eagle
Subject: Re: Generating animation
Date: 10 Feb 2023 14:05:00
Message: <web.63e6945123c5f45c1f9dae3025979125@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

> In Windows, there is an included file called 'quickres.ini.' It holds a lot of
> pre-written render resolutions for you. But it's also the place where I put all
> of my animation commands-- like Start_Frame, Final_Frame, etc. There, you would
> simply write
>            Final_Frame=100  (no spaces)
>
> This will automatically turn on the animation mechanism, ready and waiting.

No. Way.

So you're using the quickres.ini as "the" .ini file to run the animation?
That's pretty slick.

Is that in the docs somewhere, or did you find that in a post, or come up with
it yourself?   Because that's pretty darned handy.
If you have any other interesting things in your quickres, could you post a copy
here?

First the #if block in a function, now this.
Any other neat little tricks that you've got squirreled away somewhere?

Did you know that New Hampshire used to be named "Northern Virginia"?  :D

- BW


Post a reply to this message

From: Kenneth
Subject: Re: Generating animation
Date: 10 Feb 2023 18:40:00
Message: <web.63e6d53123c5f45c9b4924336e066e29@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

>
> So you're using the quickres.ini as "the" .ini file to run the animation?
> That's pretty slick.

Gee, I thought *everyone* did it that way, by default! I've been using that
set-up ever since I made my first animation. Yes, I use it as a container for
almost every kind of command and switch that I need-- like Work_Threads,
Output_File_Type, Verbose, Output_Alpha, etc etc. Then I just comment them
on/off when needed (using a semicolon of course, not slash marks.) It seems to
be a nice quick way to invoke these things for me, even faster than command-line
settings.
>
> Is that in the docs somewhere, or did you find that in a post, or come up with
> it yourself?

I wish I could remember how I arrived at the idea; maybe it just seemed natural
at the time, instead of writing specific .ini files for specific scenes. Back
then, I probably didn't know much about .ini files themselves or how to use
them... so maybe it was a lucky discovery, by pure guesswork.

Yet, I've always wondered if my use of quickres.ini is an efficient way to
invoke these commands, compared to others' strategies.


Post a reply to this message

From: Leroy
Subject: Re: Generating animation
Date: 24 Feb 2023 20:45:00
Message: <web.63f9677023c5f45cba5ca48bf712fc00@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
>
> >
> > So you're using the quickres.ini as "the" .ini file to run the animation?
> > That's pretty slick.
>
> Gee, I thought *everyone* did it that way, by default! I've been using that
> set-up ever since I made my first animation. Yes, I use it as a container for
> almost every kind of command and switch that I need-- like Work_Threads,
> Output_File_Type, Verbose, Output_Alpha, etc etc. Then I just comment them
> on/off when needed (using a semicolon of course, not slash marks.) It seems to
> be a nice quick way to invoke these things for me, even faster than command-line
> settings.
> >
> > Is that in the docs somewhere, or did you find that in a post, or come up with
> > it yourself?
>
> I wish I could remember how I arrived at the idea; maybe it just seemed natural
> at the time, instead of writing specific .ini files for specific scenes. Back
> then, I probably didn't know much about .ini files themselves or how to use
> them... so maybe it was a lucky discovery, by pure guesswork.
>
> Yet, I've always wondered if my use of quickres.ini is an efficient way to
> invoke these commands, compared to others' strategies.

I usually make an ini file for each project. I have several kind of
things(height_fields,prisms,color_maps,...) stored in in there own folders and
set Library_Path to what ever I need. I have window version and set the option
commands to what is best to what I need to do.
Have Fun!


Post a reply to this message

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