POV-Ray : Newsgroups : povray.animations : Object animated with camera following the movements : Re: Object animated with camera following the movements Server Time
17 May 2024 23:01:05 EDT (-0400)
  Re: Object animated with camera following the movements  
From: Alain
Date: 25 Nov 2009 11:24:05
Message: <4b0d5a25$1@news.povray.org>

> I want to do an animation of an object which moves in the space with non linear
> trajectory and I want the camera to follow the movements, but I can't do this,
> because when I change the "location" and "look_at vectors", the perspective
> changes suddenly; i've tried to use the "sky" statement, but I don't exactly
> know how it works and if it helps me.

How many frames do you use? If there is not enough frames, it will look 
as if the camera changes sudently.
Do you want the camera to move behind or in parallel to the object? Or 
do you want a fixed camera that points at the moving object?

> 
> To do an example, if I want do move the camera from:
> 
> x = 0
> y = 0
> z = 0
> 
> to
> 
> x = 10
> y = 5
> z = 12

For that, you can use (sample using a straight path):
camera{location<10,5,12>/clock look_at Somewhere}
//Moves the camera leaving it always looking at the sme point.

camera{location Somewhere look_at <10,5,12>/clock}
//Static camera that follows a moving point.

camera{location<10,5,12>/clock look_at<10,5,12>/clock+<10,5,12>}
//This is a camera looking forward as it moves.

> 
> pointing always the same point with a parabolic trajectory, which parameters
> have I to give to my camera statement? How can I rotate the camera in the space?
> 
> 
Changing the sky vector tend to tilt the camera. I don't think that's 
what you want.

The best way, is to use the clock to change the location or the look_at 
point the same way as you move your object. You can add some offset 
value to place the camera some distance away from your moving object.
You change both if you want the camera to follow a path parallel to that 
of the target object.

Another way, is to never change the location and look_at, but to rotate 
and translate the camera. Make the translate the last statement of the 
camera definition.

Sample:
#declare Position = [here, you calculate the translate applied to your 
object]
// The value of "Position" is used to place the moving object.

camera{location Loc look_at Position}
// "Position" is also the look_at location.
// The object is defined at the origin.

You can take a look at the "splinefollow.pov" in the "animations" folder 
that comes with the distribution. It demonstrate a complexe case where 
you follows a spline where several objects are moving. It includes 
banking of the camera in the curves.




Alain


Post a reply to this message

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