POV-Ray : Newsgroups : povray.advanced-users : Different camera parameters : Re: Different camera parameters Server Time
29 Jul 2024 02:28:18 EDT (-0400)
  Re: Different camera parameters  
From: Slime
Date: 23 Apr 2003 10:32:55
Message: <3ea6a417$1@news.povray.org>
The first thing you must understand is the difference between camera
parameters and camera modifiers.

The following are camera parameters:

    location <Location> | right <Right> | up <Up> |
    direction <Direction> | sky <Sky>

They set up the camera as shown in section 6.4.1 of the documentation
(please ignore the angle and look_at vectors in that diagram). If you use
only these parameters, the camera will turn out exactly as that picture
shows. Note that the length of these vectors is important (a longer
direction will cause the camera to zoom in more, for instance). Also note
that, at this point, the sky vector is meaningless and has absolutely no
effect.

After these vectors have been specified (or, if they're not specified, after
they take their default value), the following camera *modifiers* *change*
them:

    angle HORIZONTAL [VERTICAL] | look_at <Look_At> |
    blur_samples Num_of_Samples | aperture Size |
    focal_point <Point> | confidence Blur_Confidence |
    variance Blur_Variance | NORMAL | TRANSFORMATION

in the following ways:
- The angle keyword will change the length of the direction vector, based on
the formula direction_length = 0.5 * right_length / tan(angle / 2).
 - the look_at vector is applied in the following manner: the direction is
changed to face towards the look_at vector, the right vector is changed to
be perpendicular to [the plane created by the vectors (look_at-location) and
(sky-location)], and the up vector is made to remain along that plane. This
is the most intuitive behavior, which lets you specify where the camera is
looking at. The sky vector is used at this point to determine how much the
camera is "rolled" (so that it knows which direction is "up").
- the rest of the settings apply to focal blur and other camera features.

At this point, once all of the modifiers have been applied, transformations
(rotation, translation, etc) will be applied to the camera.

So now, to answer your specific questions:

>   For example, I fail to deduce the reason why "up -y" flips the image
> horizontally.

It probably has something to do with the order in which you specified
keywords or something. Remember that the keywords are applied in the order
described above, regardless of what order they're placed in. Chances are,
because of the use of the look_at vector, after inverting the camera
vertically, it flipped right back up because of the sky vector when look_at
was applied. If you want "up" to be -y, use "sky -y".

>   What is the difference between the 'sky' and the 'up' vectors?

The up vector is a more precise part of the camera's definition, while the
sky vector is only used to determine the general direction of the up vector
when look_at is applied.

>   Do 'angle' and 'direction' work together, or are they mutually exclusive
> alternatives to do the same thing (by different way of measuring things)?
> That is, if I specify 'direction', does it simply override a previous
'angle'
> definition, or does it add something to it instead?


'angle' changes the length of 'direction' after the camera has been set up.
'direction' will always be applied first (and multiple settings of it
override previous settings, I believe), so it is impossible to override
'angle' with 'direction' - the opposite always happens.

>   What is the relation (if any) between 'direction' and 'look_at'?

The look_at keyword modifies the direction of the 'direction', 'up', and
'right' vectors after their initial values have been set. In the end, the
direction vector, based at the location vector, will point towards the
look_at vector, but will maintain its length.

>   Perhaps 'direction' is a way of defining both 'angle' and 'look_at' with
> one single vector?

direction is the original setting, angle and look_at modify it.

I hope this helps you. It took me a *lot* of time and experience to figure
this out, so I don't blame you for not knowing. Perhaps an entry in the VFAQ
would be a good idea?

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

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