|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Modifications to the clock can be made easily with Chris Colefax's
Clockmod.inc file.
http://www.geocities.com/SiliconValley/Lakes/1434/clockmod.html
Be sure to get the tutorial as well as the autoclck.mcr file.
Best,
D.
"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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"tgl" <tgl### [at] canadacom> wrote in message
news:web.40982827a6d5375263b449400@news.povray.org...
> 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?
What Dennis Miller suggested will help for that (clock modifier macro). In
fact, also for what's asked about below by using the macro, possibly.
> 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?
You can use a #switch directive that has #range within it. Basically, you'll
need to know the time values where the interaction takes place and apply
them to #range ( ) /*change something here*/ #break so that only that
segment of clock does something. The example in the documentation should
suffice to let you know how it works (no need for #case part). If not, keep
asking questions.
Bob H.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|