|
|
Mike Horvath <mik### [at] gmailcom> wrote:
> Starting with location, direction, up and right I was able to figure out
> how to calculate the angle; however I had trouble with look_at. I could
> get a look_at that worked well enough to get an accurate render, but it
> was was always normalized between 0 and 1 unless the camera was
> orthographic. See the "Updated screen.inc" thread in p.t.s-f.
>
>
> Michael
Right, because it's not something that's going always going to be static and
untouched.
"When you specify the angle, POV-Ray adjusts the length of the direction vector
accordingly. The formula used is direction_length = 0.5 * right_length /
tan(angle / 2) where right_length is the length of the right vector. You should
therefore specify the direction and right vectors before the angle keyword. The
right vector is explained in the next section."
So unless you're going to store the "original" length of the direction vector,
which is going to be derived from look_at and location, you can only ever
backtrack to a normalized vector.
If it's a stored value, say, a scalar multiplier, then you can just multiply the
direction by that and you're back to "where you started". (assuming that's how
it all got defined)
It's like integrating - you lose the constants when you differentiate, and so
when you integrate, you just add "some constant C" into your equation.
So when you do your "reverse" calculations, all you can say for sure is "the
direction is <x, y, z> times some scalar multiplier C. Which may or may not be
important.
Post a reply to this message
|
|