camera {
location <loc>
sky <sky vector>
up <up vector>
right <right vector>
direction <direction vector>
look_at <target>
/* translations, rotations, and scales */
}
When declaring a camera, components that appear should do so in this order. This is because some later components modify previous ones, and putting them in the wrong order may result in your camera not doing exactly what you expect. Actually, the only really important ordering is that "look_at" should appear after "direction" if they are both present.
Location is pretty self evident; it tells POV-Ray where in space to locate the camera. It takes an <x, y, z> vector of the location.
Sky is used to tell the camera which way is up. Modifying this value can be used to roll the camera around its central axis.
Up, right, and direction are used to modify the field of view and aspect ratio of the image.
Direction and look_at are used to point the camera at a specific point in the scene. Direction is more typically used with up and right to define field of view then to position the camera, though.
Most of the time, you'll only need to use "location" and "look_at" to define your camera. The other specifiers can be used for fine tuning a scene and producing special effects.
After the camera is declared, it can be transformed like any other object. Any transformation applied to object modify the location of the camera and (potentially) the direction it's pointing.
The direction vector should always be perpendicular to the up and right vectors.
For more information on declaring cameras, see the camera section.
For more information on declaring cameras, see the camera section.
One thing to keep in mind when using look_at is that the location and look_at points should never be set so that the camera is looking directly down (parallel to the y-axis). If you want an "overhead" view, either offset the camera some small amount in the x or z direction, or rotate the entire scene so it just appears like you're looking straight down (but are actually looking along, say, the z-axis).
For more information on declaring cameras, see the camera section.
width = 2 * atan(|right| / |direction|)
This diagram may help make the relationship of the right and direction vectors more clear. This is a diagram of the viewing pyramid as it would look from above.
Increasing the magnitude of the right vector will make the viewing pyramid wider, and consequently make the image appear "squished" in the left-right direction. Conversely, decreasing the magnitude of the right vector will make the viewing pyramid thinner, and make the image appear "stretched" in the left-right direction. Making the value of the right vector negative will reverse the image left to right. A right vector with a magnitude of zero is bad.
The first image below was rendered with "right <4/3, 0, 0>", the second with "right <1, 0, 0>", and the third also with "right <1, 0, 0>" but rendered at 120x120 instead of 160x120.
For more information on declaring cameras, see the camera section.
For more information on declaring cameras, see the camera section.
height = 2 * atan(|up| / |direction|)
This diagram may clarify the relationship between the up and direction vectors. This is a diagram of the viewing pyramid as it would look from the side.
The default value of the up vector is "up <0, 1, 0>". This, together with the value "right <4/3, 0, 0>" (also default) defines the aspect ratio of the rendered image to be (4/3) / (1) = 4/3. This is the standard aspect ratio for most computer screens. Resolutions like 800x600, 640x480, and 1024x768 all have 4/3 aspect ratios. 320x200 also has a 4/3 aspect ratio, even though it would seem like it should be 8/5. This is because this resolution does not use square pixels. To prevent your image from looking distorted, it's a good idea to make the camera's aspect ratio the same as the image's aspect ratio.
Modifying the value of the up vector independently of the right and direction has the same stretch/squish effect as with the right vector, only this stretch/squish is in the vertical direction.
The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team