Camera and viewing parameters
Keywords: tachyon

Next: Including Files Up: Scene Description Files Previous: Basic Scene Requirements Contents Index
Subsections

- Camera projection modes
- Common camera parameters
- Viewing frustum

##
Camera and viewing parameters

One of the most important parts of any scene, is the camera position and orientation. Having a good angle on a scene can make the difference between an average looking scene and a strikingly interesting one. There may be multiple camera definitions in a scene file, but the last camera definition overrides all previous definitions. There are several parameters that control the camera in Tachyon, PROJECTION, ZOOM, ASPECTRATIO, ANTIALIASING, CENTER, RAYDEPTH, VIEWDIR, and UPDIR.

The first and last keywords required in the definition of a camera are the CAMERA and END_CAMERA keywords. The PROJECTION keyword is optional, the remaining camera keywords are required, and must be written in the sequence they are listed in the examples in this section.

###
Camera projection modes

The PROJECTION keyword must be followed by one of the supported camera projection mode identifiers PERSPECTIVE, PERSPECTIVE_DOF, ORTHOGRAPHIC, or FISHEYE. The FISHEYE projection mode requires two extra parameters FOCALLENGTH and APERTURE which precede the regular camera options.

    Camera
      projection perspective_dof
      focallength 0.75
      aperture 0.02
      Zoom 0.666667
      Aspectratio 1.000000
      Antialiasing 128
      Raydepth 30
      Center  0.000000 0.000000 -2.000000
      Viewdir -0.000000 -0.000000 2.000000
      Updir   0.000000 1.000000 -0.000000
    End_Camera

###
Common camera parameters

The ZOOM parameter controls the camera in a way similar to a telephoto lens on a 35mm camera. A zoom value of 1.0 is standard, with a 90 degree field of view. By changing the zoom factor to 2.0, the relative size of any feature in the frame is twice as big, while the field of view is decreased slightly. The zoom effect is implemented as a scaling factor on the height and width of the image plane relative to the world.

The ASPECRATIO parameter controls the aspect ratio of the resulting image. By using the aspect ratio parameter, one can produce images which look correct on any screen. Aspect ratio alters the relative width of the image plane, while keeping the height of the image plane constant. In general, most workstation displays have an aspect ratio of 1.0. To see what aspect ratio your display has, you can render a simple sphere, at a resolution of 512x512 and measure the ratio of its width to its height.

The ANTIALIASING parameter controls the maximum level of supersampling used to obtain higher image quality. The parameter given sets the number of additional rays to trace per-pixel to attain higher image quality.

The RAYDEPTH parameter tells Tachyon what the maximum level of reflections, refraction, or in general the maximum recursion depth to trace rays to. A value between 4 and 12 is usually good. A value of 1 will disable rendering of reflective or transmissive objects (they'll be black).

The remaining three camera parameters are the most important, because they define the coordinate system of the camera, and its position in the scene. The CENTER parameter is an X, Y, Z coordinate defining the center of the camera (also known as the Center of Projection). Once you have determined where the camera will be placed in the scene, you need to tell Tachyon what the camera should be looking at. The VIEWDIR parameter is a vector indicating the direction the camera is facing. It may be useful for me to add a "Look At" type keyword in the future to make camera aiming easier. If people want or need the "Look At" style camera, let me know. The last parameter needed to completely define a camera is the "up" direction. The UPDIR parameter is a vector which points in the direction of the "sky". I wrote the camera so that VIEWDIR and UPDIR don't have to be perpendicular, and there shouldn't be a need for a "right" vector although some other ray tracers require it. Here's a snippet of a camera definition:

    CAMERA
      ZOOM 1.0
      ASPECTRATIO 1.0
      ANTIALIASING 0
      RAYDEPTH 12
      CENTER 0.0 0.0 2.0
      VIEWDIR 0 0 -1
      UPDIR 0 1 0
    END_CAMERA

###
Viewing frustum

An optional FRUSTUM parameter provides a means for rendering sub-images in a larger frame, and correct stereoscopic images. The FRUSTUM keyword must be followed by four floating parameters, which indicate the top, bottom, left and right coordinates of the image plane in eye coordinates. When the projection mode is set to FISHEYE, the frustum parameters correspond to spherical coordinates specified in radians.

    CAMERA
      ZOOM  1.0
      ASPECTRATIO 1.0
      ANTIALIASING 0
      RAYDEPTH  4
      CENTER    0.0 0.0 -6.0
      VIEWDIR   0.0 0.0 1.0
      UPDIR     0.0 1.0 0.0
      FRUSTUM   -0.5 0.5 -0.5 0.5
    END_CAMERA

Next: Including Files Up: Scene Description Files Previous: Basic Scene Requirements Contents Index