POV-Ray : Newsgroups : povray.animations : How do you do your Animations? : Re: How do you do your Animations? Server Time
16 Apr 2024 08:03:53 EDT (-0400)
  Re: How do you do your Animations?  
From: Dick Balaska
Date: 14 Jan 2020 00:24:37
Message: <5e1d5095$1@news.povray.org>
Am 1/13/20 5:47 PM, also sprach Leroy:
> I just wondering how other people here do their animations. I've done a few,
> some very long 3 minutes or more. I started a new one, a simple walk through,
> around a building with lots of belts and pulleys.
>   On most of my other animations I use one pov file per scene. Each scene had all
> the things needed for that bit of animation. Now that I'm doing a walk through I
> plan on using one file that has every thing needed and drop things not in view.
> I'll have one file that has all the camera locations in an array that will give
> the values for each frame. Then when the values are used drop the array using
> the #undef function.
>   Any thoughts will handy.
> Have Fun!

I'm not following you.  It sounds like you're not using clock the way I 
would.  If it works for you, by all means continue, but I don't 
understand the need to define an array of all possible camera locations 
and then undef'ing them.

#declare sceneLength = 120*seconds;	// (seconds = 1)
#declare myclock = clock*sceneLength;	// inc from 0 to 120 each frame

#declare scene1Start=0;
#declare scene1End=60;
#declare scene2Start=60;
#declare scene2End=120;

// 2 helper macros I use.
// Animate this segment of the clock from 0 to 1
#macro AniSegment(_start, _end)

// Move a Vector from, to, increment
#macro MoveV(_from, _to, __i)

// Move a float: from, to, increment
#macro MoveF(_from, _to, __i)

#switch (myclock)
   // Handle the first scene's camera
   #range(scene1Start, scene1End)
     #local I=AniSegment(scene1Start, scene1End);
     #local CameraStart=<0,0,0>;
     #local LookatStart=<0, 0, 100>;
     #local CameraEnd=<0,0,100>;
     #local LookatEnd=<100,0,100>;
     #declare Camera=MoveV(CameraStart, CameraEnd, I);
     #declare Lookat=MoveV(LookatStart, LookatEnd, I);
   // Handle the second scene's camera
   // Note the camera start is the same as the end of the previous scene
   // This is to make a seamless move, you can jump cut too.
   #range(scene2Start, scene2End)
     #local I=AniSegment(scene2Start, scene2End);
     #local CameraStart=<0,0,100>;
     #local LookatStart=<100, 0, 100>;
     #local CameraEnd=<0,100,100>;
     #local LookatEnd=<100,100,100>;
     #declare Camera=MoveV(CameraStart, CameraEnd, I);
     #declare Lookat=MoveV(LookatStart, LookatEnd, I);


Anyway, that's how I would do it.  It looks like more boilerplate to 
setup, but it gives you flexibility.  If you decide to make scene 1 
longer, you only have to change 2 numbers.
Plus, I've abstracted out frame_number.  You can run this at 20 FPS by 
declaring Final_Frame=240 in your ini file, or 30 FPS by
declaring Final_Frame=360.

Here, this is one of my actual director files for my space landing scene.

First, I declare any important positioning vectors.
Second, I declare the timings for the scene.
Third, run the big #declare Camera #switch (line 345)
Forth, run the big #declare Lookat #switch (line 515)
I found that Lookat isn't 100% the same thing as Camera. i.e.
"Look at SpaceLoco, wait a beat, start to walk towards SpaceLoco".
Last, more #switch loops for various timings.  I often have things that 
are point A, then move point A to B, then point B.
#declare Thing1Start=0.75*seconds;
#declare Thing1End=1.0*seconds;

#switch (myclock)
   #range(0, Thing1Start)
     #declare ThingPos=0;
   #range(Thing1Start, Thing1End)
     #local I=AniSegment(Thing1Start, Thing1End);
     #declare ThingPos=I;  // between 0.75-1.0 seconds, move from 0-1
   #range(Thing1End, sceneLength)
     #declare ThingPos=1;

Oh, my first rule of animation is everything runs from 0-1.
As much as possible every move is from 0-1.
Because once you get that number, you can manipulate it.

Move a vector smoothly from left to right:
#declare V=MoveV(<-100,0,0>, <100,0,0>, ThingPos);

Bring the lights up smoothly from 20% to 80%
#declare LightBright=MoveF(0.0, 0.6, ThingPos)+0.2;

I hope that all makes a little bit of sense. :)

Am 1/13/20 7:09 PM, also sprach Bald Eagle:
 > Dick Balaska obviously has his own mini cinematic production company 
 > away in his living room and across the internet - so that may be on 
 > level entirely.  ;)

:D :D :D

Rendered 49,882,521,600 of 49,882,521,600 pixels (100%)

Post a reply to this message

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