POV-Ray : Newsgroups : povray.animations : Camera/Object/Clock : Re: Camera/Object/Clock Server Time
28 Sep 2024 09:16:14 EDT (-0400)
  Re: Camera/Object/Clock  
From: Bill SG
Date: 5 May 2004 06:41:48
Message: <4098c4ec@news.povray.org>
The answer is a definite yes. It's just a matter of some mathematics.

1. You want to control the camera's position as a function of time. You
didn't give enough info here to solve the equations entirely, so I will add
a few parameters. Let's call the positions along your straight line Xa, Xb,
Xc and Xd. I'll assume you are moving along the positive X axis, but you
could generalize this or rotate and translate the position after the
calculation. The time that the camera is at each position is ta, tb, tc and
td. So the amount of time to go from A to B is tb - ta. the distance covered
is Xb - Xa. The equation for position as a function of time with a constant
acceleration is X = 1/2 * accel * t * t. So solve for accel = 2 * (Xb - Xa)
/ ((tb - ta) * (tb - ta)). Now that you know accel, for each frame use X =
1/2 * accel * (t - ta) * (t - ta) to get X. The speed at that point will be
V = accel * (tb - ta). So for the second interval, tb to tc, the position
will be Xb + V * (t - tb). The distance covered with a constant deceleration
is X = 1/2 * decel * t * t. Calculate decel = 2 * (Xd - Xc) / ((td - tc) *
(td - tc)). For the third interval, X = Xd - 1/2 * decel * (td - t) * (td -
t).

I didn't test these equations, but they should be right or pretty close. If
the fixed speed is what's important rather than the time intervals, you will
have to rearrange the equations a bit.

2. Sorry, but I don't have the time to solve this one. It's a bit more
complicated, because there are three dimensions perhaps for the object's
position relative to the camera. Also, you want to start moving the look_at
when the object is almost out of the field of view, rather than when it is
in the center (zero position) of the field of view. Finally, you will want
to move the look_at back to straight on gradually, not instantaneously. But
the principles are the same.

Bill


"tgl" <tgl### [at] canadacom> wrote in message
news:web.40982827a6d5375263b449400@news.povray.org...
>   Hello Everyone
>    Once again I'm in need of some SDL help in describing the following
> camera motions:
>    1. The camera will travel in a straight line, looking straight ahead,
> beginning at point A where it's speed is zero. Between point A and B,
speed
> gradually increases to a set value and then maintains that set value speed
> from point B to point C. At point C, speed decreases to 0 at point D. Can
> this entire sequence be related to clock?
>    2. In the above sequence, at some pre-determined period during the time
> the camera is travelling from point B to C, an object crosses the camera's
> path. The object and the camera will be in proximity of one another and
the
> camera will see it. When the object is about to leave the camera's frame
of
> view, regardless of the object's direction, the camera will pan to follow
> the object briefly and then resume its previous view; like a glancing
look.
> Could the camera's motion to "look_at" the object's passage be controlled
> by clock?
>     I hope I have made some kind of sense to someone out there. Thank you
in
> advance to all who respond.
>     TGL
>


Post a reply to this message

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