POV-Ray : Newsgroups : povray.newusers : Moving Camera : Re: Moving Camera Server Time
28 Jul 2024 22:25:04 EDT (-0400)
  Re: Moving Camera  
From: Tim Attwood
Date: 15 Jun 2007 19:37:47
Message: <467322cb$1@news.povray.org>
> I'm new to POV, and I'm trying to make a camera follow a certain path. For 
> a
> total time of 5, I want the camera to spend 0<t<1 at a certain point, then
> move along a specific circular path over time 1<t<2, and then remain at 
> the
> end
> point of this path for t>2. This is the code i wrote for it, but it 
> doesn't
> seem to work. I'm sure I'm missing someting stupidly obvious, but could
> someone give me a hand. Either de-bug or a pointer in the right direction
> would be helpful.
...
> //declare variables for camera motion
> #declare loopcount = 0;
> #declare X = 0;
> #declare Y = 0;
> #declare Z = -3.5;
> #declare Ystep = -.01375;
> #declare Zstep = -.0125;
>
> #if (clock <= 1)

the clock variable defaults to 0..1,
this can be changed in the ini files
or with command line commands,
if you've done that great, otherwise use 1/5 instead...

> camera {
> location <0,0,-3.5 >
> look_at <0,0,0>}
>
> #else #if (clock <= 2)

After holding still you want the
camera to move for 1/5 of the animation.
So just set up another variable for clock
durring that time...

#else
   #local My_clock = clock-1/5;
or
  #local My_clock = clock - 1;


> //move camera coords
>  #while loopcount <= 200
>   Y = Y + Ystep;
>   Z = Z + Zstep;
>  #end // end while

This while loop executes the whole loop, but why?
just leave that out, the animation loop will re-parse
the whole scene for every frame with a different
clock value.

> camera {
>  location <0, Y, Z >
>  look_at <0,0,0>
>  }

Y an Z have the same value every time...
try something like...
#local CLOC = vrotate(<0,0.75,0>;90*My_clock*y)+<0,-2.75,0>;
camera {
   location CLOC
   look_at <0,0,0>
}

You might also look into using a spline, that might make lining
up the start and stop of your movements line up easier
if you decide to change it later.

> #else
> camera{
>  location<0,-2.75,-1>
>  look_at<0,0,0>
>  }
> //end cameras


Post a reply to this message

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