Camera Data Type
 
 
 

Declaration:

camera <name> ( <component list> ) ;

Reference:

<name>fov

Literal:

camera ( <component list> )

Purpose:

This defines a camera. A camera is an object that may be defined as a literal (see Specifying Literals) in the MODEL Section. Similarly, a variable of type camera may be instanced (see Declaring Variables). Each camera in the MODEL section (whether instanced or literal) is capable of producing output independent of any other cameras. If a camera is specified as a variable, it must have a name. Any of the following components may be given between the parentheses:

All components are specified using a keyword=value form. Components are separated by commas. Not all components are optional. The components may be specified in any order. Components that are not specified take on their default value. If any component is specified more than once, the last such specification will be used, and all previous ones ignored.

The camera’s location is (0, 0, 0). The location of the eye is the same as that of the camera. The location of the camera corresponds to the apex of a pyramid that encloses all of the objects which will be seen in the rendered image. These objects are projected on a window onto the world whose relative dimensions are defined by the fov and aspect statements. Orientation of the “viewing” pyramid is done by transforming the whole camera in the scene using the normal mechanisms.

Aiming the camera is accomplished by transforming the camera like any other object.

The name of the output file(s) created may be regarded as camera information since each camera will necessarily output its own view of the scene. If more than one camera (either literal or instance) is present in the MODEL section, then the second one encountered and all subsequent ones must have a pix component or a mask component (or both) specified to define where the result of the rendering is to be output. If such a required component is absent, then an error condition exists and the processing is stopped with an error message. The first camera encountered must likewise have a destination for its output. However, unlike subsequent ones, the first camera has a default (the image goes to “stdout”, no mask is produced). It may also be set by the DEFINITION Section parameters or by the command line options. Note that if the first camera’s output is specified in more than one of the 3 possible ways (command line, operation parameter, camera component), then the command line specification will be used, if given, and failing that, the camera component will be used. Specification of camera output by use of DEFINITION parameters will only be used if no other specification has been given.

NoteDue to numerical precision problems, the camera’s motion is unstable if it passes directly over the vertical pole and is looking straight down (the Y axis in Y-UP systems, or the Z axis in Z-UP systems). To avoid this problem when animating the camera, ensure that it is at least one degree off the pole

The aspect ratio, in the Alias system, is a product of the pixel aspect ratio and the image aspect ratio. The pixel aspect ratio is currently saved in the field aspect_ratio_pixel. When using SGI equipment, numbers are based on square pixels, which have a ratio of 1:1; hence, no additional multiplication is required. The pixel aspect ratio may be different for other machines. If you’re using such a machine, multiply the pixel aspect ratio times the image aspect ratio as given, and edit the aspect ratio in SDL to reflect these new numbers.

Table of Pixel Aspect Ratios

Pixel Aspect Ratio Format
1 : 1 IRIS NTSC
1 : 1 IRIS PAL
4 : 3 Raster Tek's Hidef Frame Buffer
9 : 8 Abekas Internal Frame Buffer
4 : 3 Raster Tek's NTSC Frame Buffer
9 : 10 Quantel's Harry Interface
1 : 1 Full Frame 1K width
1 : 1 Motion Picture 1K with sound track
1 : 1 Motion Picture, no sound track

For example, if the aspect ratio part of the SDL Camera statement currently reads

aspect = 320 / 240,

and you are using Quantel’s Harry Interface, edit it to read:

aspect = ((320 / 240) * (9/10)),
aspect_ratio_pixel = (9/10),

Example:

camera only_camera ( view       = (-2.1, -2.1, -2.1),
	twist = -17.9;
	fov = 35.0,
	aspect = 320 / 240,
	viewport = (0, 319, 0, 239),
	near = 0.2
	);

By default, Alias creates a “pixel_aspect” variable in the DEFINITION Section of SDL that allows you to quickly change the pixel aspect ratio should you need to. Then the below statement should be in the camera description

aspect_ratio_pixel = pixel_aspect,

active

Syntax:

active = <scalar>

Range:

0 (FALSE) or not 0 (TRUE)

Default:

TRUE

Purpose:

A Boolean flag that controls whether the camera will be used or not.

Comments:

This component may be animated.

Example:

active = FALSE

aspect

Syntax:

aspect = <scalar>

Range:

>0

Default:

1.0

Purpose:

This defines the ratio of the x and y dimensions of the window of the world. All visible objects are projected onto this window. In order for objects not to be distorted, the aspect ratio of the physical rectangle on the screen defined by the viewport statement must be the same as the value for aspect. Some output devices do not have square pixels. In order to create undistorted images, the following formula provides the correct aspect ratio: ( vp width / vp height ) * ( pixel width / pixel height ) where “vp” means viewport.

Starting version 7, the definition of aspect has changed slightly. It just indicates the pixel aspect ratio. The viewport is no longer a needed consideration because it is computed on-the-fly in version 7.

Comments:

This component may be animated.

Example:

aspect = ((xright – xleft) / (yhigh – ylow))

This example uses an expression made up of system defined variables. It is appropriate for an image that will be output to a device that has square pixels.

aspect_ratio_pixel

Syntax:

aspect_ratio_pixel = <scalar>

Range:

>0

Default:

1.0

Purpose:

This defines the pixel aspect ratio appropriate for different output devices.

Comments:

This component may be animated.

Example:

aspect_ratio_pixel = 1.0

This example is appropriate for an image that will be output to a device that has square pixels.

auto_focus

Syntax:

auto_focus= <scalar>

Range:

0 (FALSE) or 1 (TRUE)

Default:

FALSE

Purpose:

This is relevant when depth of field is turned on. If auto_focus is turned on, then the focus point is the lookat point of the camera. If auto_focus is turned off, then the focal_distance is used to determine the focus point.

Comments:

This component may be animated.

Example:

auto_focus = FALSE

depth_file

Syntax:

depth_file = <filename>

Purpose:

This defines the filename used as output for a floating point depth value for each pixel, instead of a color or mask value.

For users who want to read the file, or write utilities that make use of the file, the format is as follows:

1 integer (the file's magic number) should be 55655

1 short (the image width, or X dimension)

1 short (the image height, or Y dimension)

X * Y floats (representing the pixels)

To use the results as an 8-bit texture file, see depthmap in the Standalone Utilities manual.

depth_of_field

Syntax:

depth_of_field = <scalar>

Range:

0 (FALSE) or not 0 (TRUE)

Default:

FALSE

Purpose:

This specifies that depth of field will be used when RayTracing. Most renderers in the world mimic a pin hole camera, which has an infinite depth of field. RayTracing allows the use of real depth of field, simply and easily. Only the distance of focus in the scene, and the focal_length and f_stop of the lens have to be specified.

Comments:

This component may be animated. You must specify focal_distance if depth_of_field is TRUE.

Example:

depth_of_field = TRUE

far

Syntax:

far = <scalar>

Range:

Any positive floating point number greater than the value assigned to near.

Default:

1000

Purpose:

This sets the position of the far plane. Objects are not clipped to the far plane. However, calculations for fog use the far value to compute the distance from the camera to the background. Objects in the scene that are further than the clipping plane will not render correctly.

Comments:

This component may be animated.

Example:

far = 50.0

filmaperture_x

Syntax:

filmaperture_x = <scalar>

Range:

Any positive floating point number greater than 0.

Default:

1

Purpose:

This sets the aperture width in the horizontal direction. Another term for aperture in camera terminology is film back.

Comments:

This component is only relevant for perspective cameras. The region outside of that defined by the filmaperture and filmoffset will be rendered in black.

Example:

filmaperture_x = 1.0

filmaperture_y

Syntax:

filmaperture_y = <scalar>

Range:

Any positive floating point number greater than 0.

Default:

1

Purpose:

This sets the aperture width in the vertical direction. Another term for aperture in camera terminology is film back.

Comments:

This component is only relevant for perspective cameras. The region outside of that defined by the filmaperture and filmoffset will be rendered in black.

Example:

filmaperture_y = 1.0

filmoffset_x

Syntax:

filmoffset_x = <scalar>

Range:

Any floating point number less than half of filmaperture_x.

Default:

0

Purpose:

This sets the film offset in the horizontal direction.

Comments:

This component is only relevant with perspective cameras. The region outside of that defined by the filmaperture and filmoffset will be rendered in black.

Example:

filmoffset_x = 0.0

filmoffset_y

Syntax:

filmoffset_y = <scalar>

Range:

Any floating point number less than half of filmaperture_y.

Default:

0

Purpose:

This sets the film offset in the horizontal direction.

Comments:

This component is only relevant with perspective cameras. The region outside of that defined by the filmaperture and filmoffset will be rendered in black.

Example:

filmoffset_y = 0.0

focal_distance

Syntax:

focal_distance = <scalar>

Range:

Non-negative.

Default:

none

Purpose:

The focal distance is the distance from the camera (lens) to a point in the scene upon which the lens is focused. The value specified is interpreted as being in units of feet to agree with depth of field charts in published guides.

Comments:

This must be specified if depth_of_field is true.

This component may be animated.

Example:

focal_distance = 15.0

focal_length

Syntax:

focal_length = <scalar>

Range:

Greater than 1

Default:

35

Purpose:

The focal length of the lens is a property of the lens. The value specified is interpreted as being in units of millimeters.

Comments:

This component may be animated.

Example:

focal_length = 50.0

fov

Syntax:

fov = <scalar>

Range:

0.2 to 179.

Default:

45

Purpose:

This statement sets the camera’s field of view in degrees. A setting of 40 approximates a 35mm lens, and 20 is a 50mm lens. Note that for very wide angles, the distortions are not those of an actual wide-angle optical lens. A value outside the above range will generate a run time error message.

Starting in version 6.0 of SDL, instead of specifying the field of view with fov, it is possible to specify it using aov, which stands for angle of view (this is the more classical camera terminology). Both are identical in definition. Furthermore, if the SDL file states that it is a version 6.0 file (or greater), the fov will be interpreted as cropping in the vertical direction, rather than the previously cropped horizontal direction.

Comments:

This component may be animated.

Example:

fov = 20

f_stop

Syntax:

f_stop = <scalar>

Range:

Non-negative.

Default:

8

Purpose:

Any good photography reference guide will contain a depth of field table giving focal distances based on focal length and f stop. You may then choose whichever focal_length / f stop combination produces the desired result, and render the image. The same reference manual will also have a section for calculating f stop and focal length directly from the focal_distance, fov and aspect ratio.

Comments:

This component may be animated.

Example:

f_stop = 5.6

mask

Syntax:

mask = <filename>

Default:

Special — see the comments.

Purpose:

To define the output destination of the mask file produced by this camera.

Comments:

Each camera in the MODEL section (whether instanced or literal) is capable of producing output independent of any other cameras. The output may be an image file, a mask file or both. If this (mask) component is specified, then a mask output is produced. If it is omitted, then no mask is created for this camera. A similar situation exists for the pix component. If both the pix and the mask components are absent, then either a default is used or an error occurs, depending upon the circumstances described below.

If more than one camera (either literal or instance) is present in the MODEL section, then the second one encountered and all subsequent ones must have a pix component or a mask component (or both) specified to define where the result of the rendering is to be output. If such a required component is absent, then an error condition exists and the processing is stopped with an error message. The first camera encountered must likewise have a destination for its output. However, unlike subsequent ones, the first camera has a default (an image is produced and goes to “stdout”, no mask is produced). It may also be set by the DEFINITION parameters or by the command line options. Note that if the first camera’s output is specified in more than one of the 3 possible ways (command line, operation parameter, camera component), then the command line specification will be used, if given, and failing that, the camera component will be used. Specification of camera output by use of DEFINITION parameters will only be used if no other specification has been given.

Only the first camera may have its output specified by default, or by the command line or by an DEFINITION parameter. All other cameras must have either the pix component or the mask component (or possibly, but not necessarily, both) specified.

The actual name of an output file produced by a camera (either PIX or MASK or both) may be different from what is specified by the user. The name used is comprised of four parts:

The first, or specified part, is exactly what was specified by the user (which may or may not have an extension. Refer to the section on filenames for more information).

The second, or stereo part, is only used when rendering stereo images. When stereo = TRUE either “_left” or “_right” will be appended to the name appropriately.

The third, or animation part, is used only when rendering an animation (that is, when animation = TRUE). A further “dot” extension is appended to the name. (This is not to be confused with a user specified extension.)

This will be a non-negative integer prefixed by a single period (“dot”). Its value will be equal to startextension for the first frame and will increment by the value of byextension for each subsequent frame produced. Refer to the descriptions on startextension and byextension in the Definition section of this manual for more information.

The fourth, or fields portion is only produced when rendering on fields (that is, when fields = TRUE). The single character “e” is appended to the names of all files produced for an “EVEN” field, and the single character “o” is appended for “ODD” ones.

Comments:

This component may be animated.

Example:

mask = ("~/mask/thisone") 

matte_depth

Syntax:

matte_depth= <scalar>

Range:

-infinity to infinity

Default:

Purpose:

Specifies a distance in units from the eye point. Thus, positive values indicate that the matte plane is behind the camera — we recommend this be used only when you are raytracing reflections that are behind the camera. Note that the matte_plane description must precede the matte_depth and matte_order descriptions.

NoteNote: Specify either matte_depth or matte_order, not both.

Example:

matte_depth = -10.0

matte_order

Syntax:

matte_order= <scalar>

Range:

-infinity to infinity

Default:

Purpose:

Specifies a distance in units from the eye point. A positive value indicate that the matte_plane is behind the entire geometry database, and a negative value indicate that the matte-plane is in front of the database. Larger values determine the front-ordering of these matte-planes. Note that the matte_plane description must precede the matte_depth and matte_order descriptions.

NoteA matte_order value of 0 indicates NO ordering. This means that it resides exactly at the back of any rendering (sort of like a backdrop).
NoteSpecify either matte_depth or matte_order, not both.

Example:

matte_order = -0.500000

matte_plane

Syntax:

matte_plane= <texture>

Range:

Default:

Purpose:

Specifies the name of a file texture to be used as a matte plane.

At the moment, only file textures (like “file” and “stencil”) are being handled in matte-planes in the interactive package. In the Scene Description Language, other texture-types can be applied to matte-planes.

Example:

texture back (
 procedure = Stencil,
 mask_level = 1.0,
 mask_blur = 0.0,
 edge_blend = 0.0,
 positive_key = OFF,
 image_file = "/usr/u/myname/user_data/demo/pix/back.pix.1",
 key_masking = ON,
 color_key = (1.000000, 1.000000, 1.000000),
 hue_range = 0.500000,
 sat_range = 0.500000,
 val_range = 0.500000,
 threshold = 0.500000,
 active = TRUE,
 rgbmult = (1.000000, 1.000000, 1.000000),
 rgboffset = (0.000000, 0.000000, 0.000000),
 ucoverage = 1.000000,
 vcoverage = 1.000000,
 utranslate = 0.000000,
 vtranslate = 0.000000,
 uwrap = TRUE,
 vwrap = FALSE,
 urepeat = 320.000000 / 321.000000,
 vrepeat = 241.000000 / 241.000000,
 uoffset = 50.000000 / 321.000000,
 voffset = 0.000000 / 241.000000
);

This is an example of using a matte-plane with the filename "back.pix.1" and chroma-keying specified. If no chroma-keying or matte-files are specified, then the "file" texture is used instead.

motion_blur

Syntax:

motion_blur = <scalar>

Default:

ON

Range:

0 (OFF) or non-zero (ON)

Purpose:

If motion_blur is turned on for the file, this flag indicates that motion blur should be calculated for this object.

Example:

motion_blur = ON

near

Syntax:

near = <scalar>

Range:

Unexpected results may be produced when near is assigned a very small value. Therefore, the recommended minimum setting is 0.1. The number must be greater than 0.

Default:

0.2

Purpose:

This sets the position of the near clipping plane. It truncates the pyramid of vision when objects come too close to the apex. Interior sectional views of objects are attained by setting the near plane within the objects.

Comments:

This component may be animated.

Example:

near = 1.0

perspective

Syntax:

perspectivet = <scalar>

Range:

0 (FALSE) or not 0 (TRUE)

Default:

TRUE

Purpose:

A Boolean flag that controls the projection scheme. The camera uses perspective projection if the flag is TRUE; otherwise, it uses orthographic projection.

Comments:

If perspective = FALSE, win_xsize and win_ysize must be specified.

Example:

perspective = FALSE

pix

Syntax:

pix = <filename>

Default:

Special — see the comments.

Purpose:

Defines the destination of the image file produced by the camera.

Comments:

Each camera in the MODEL section (whether instanced or literal) is capable of producing output independent of any other camera. The output may be an image file, a mask file or both. If this (pix) component is specified, then an image output is produced. If it is omitted, then no image is created for this camera. A similar situation exists for the mask component. If both the pix and the mask components are absent, then either a default is used or an error occurs, depending upon the circumstances given below.

If more than one camera (either literal or instance) is present in the MODEL Section, then the second one encountered and all subsequent ones must have a pix component or a mask component (or both) specified to define where the result of the rendering is to be output. If such a required component is absent, then an error condition exists and the processing is stopped with an error message. The first camera encountered must likewise have a destination for its output.

However, unlike subsequent ones, the first camera has a default (an image is produced and goes to “stdout”, no mask is produced). It may also be set by the DEFINITION Section parameters or by the command line options. Note that if the first camera’s output is specified in more than one of the 3 possible ways (command line, operation parameter, camera component), then the command line specification will be used, if given, and failing that, the camera component will be used. Specification of camera output by use of DEFINITION parameters will only be used if no other specification has been given.

Only the first camera may have its output specified by default, or by the command line or by an DEFINITION parameter. All other cameras must have either the pix component or the mask component (or possibly, but not necessarily, both) specified.

The actual name of an output file produced by a camera (either PIX or MASK or both) may be different from what is specified by the user. The name used is comprised of four parts:

The first, or specified part, is exactly what was specified by the user (which may or may not have an extension. Refer to the section on filenames for more information).

The second, or stereo part, is only used when rendering stereo images. When stereo = TRUE either “_left” or “_right” will be appended to the name appropriately.

The third, or animation part, is used only when rendering an animation (that is, when animation = TRUE). A further “dot” extension is appended to the name. (This is not to be confused with a user-specified extension.)

This will be a non-negative integer prefixed by a single period (“dot”). Its value will be equal to STARTEXTENSION for the first frame and will increment by the value of BYEXTENSION for each subsequent frame produced. Refer to the descriptions on startextension and byextension in the Definition section of this manual for more information.

The fourth, or fields portion is only produced when rendering on fields (that is, fields = TRUE). The single character “e” is appended to the names of all files produced for an “EVEN” field, and the single character “o” is appended for “ODD” ones.

Comments:

This component may be animated.

Example:

pix = ("~/pix/thatone")

placement_fit_code

Syntax:

placement_fit_code = <scalar>

Range:

0, 2

Default:

0.0

Purpose:

Placement_fit_code is only relevant when the aspect ratio of the filmback does not match the aspect ratio of the rendering resolution. If there is a mismatch in aspect ratios, then there will be some clipped out regions in the resultant rendering. There are three variations in clipping out regions:

Example:

placement_fit_code = 0.0

placement_shift

Syntax:

placement_shift = <scalar>

Range:

-1, 1

Default:

0.0

Purpose:

Placement_shift is only relevant when the aspect ratio of the film back does not match the aspect ratio of the rendering resolution. If there is a mismatch in aspect ratios, there will be some clipped out regions in the resultant rendering, as described above. When placement_shift is set to 0, the image will be centered so that the clipped out regions will be equally divided on both ends. If set to -1, then the image is shifted to the right (or to the top), where one end of the clipped out region becomes totally visible. A setting of 1 has a similar effect, but in the opposite direction.

Example:

placement_shift = 0.0

scaling_factor

Syntax:

scaling_factor= <scalar>

Range:

> 0

Default:

1.0

Purpose:

Scaling_factor is only relevant to depth_of_field. This provides for a better control of the fuzzy effects from depth of field. The larger the scaling_factor, the more amplified the depth of field’s fuzzy effects.

Example:

scaling_factor = 1.0

twist

Syntax:

twist = <scalar>

Range:

unlimited

Default:

0.0

Purpose:

The twist sets the degrees of tilt away from the camera’s vertical axis. Tilting the camera clockwise with a positive twist setting makes the world look like it is tilted to the left.

Comments:

This component may be animated. twist is ignored if up is specified.

Example:

twist = (animate( roll, frame ))

units_to_feet

Syntax:

units_to_feet = <scalar>

Range:

greater than 0.0

Default:

0.0

Purpose:

units_to_feet allows the definition of focal_distance in units other than feet (for example, in meters). The value of units_to_feet is the length of the unit as expressed in terms of feet. In case of focal distance defined in meters, units_to_feet will be 0.3048 since 0.3048 meters equals one foot.

Comments:

This component may be animated.

Example:

units_to_feet = 1.0

up

Syntax:

up = <triple>

Range:

unlimited

Default:

0.0, 1.0, 0.0

Purpose:

The up vector is used as a reference to define the angle of twist, and is one of the components affecting the orientation of the camera.

Comments:

This component may be animated. twist is ignored if up is specified.

Example:

up = (animate( roll, frame ))

view

Syntax:

view = <triple>

Range:

There are no limits to value; however, if 0.0 or very large numbers are used (for example, 10000000), unpredictable behavior may occur.

Default:

Not applicable — see below.

Purpose:

This describes the location in space, in absolute world coordinates, toward which the camera is directed. The three components of the triple correspond to the x, y and z coordinates, respectively. To always look at the same point, use this statement. If not specified, the camera simply looks down the axis of the viewing pyramid ( 0, 0, -1 relative to the camera) and is controlled by transforming the camera as a whole.

Comments:

This component may be animated.

Example:

view = some_trip_var_name

viewport

Syntax:

viewport = ( <scalar> , <scalar> , <scalar> , <scalar> )

Range:

unbounded

Default:

(0, 644, 0, 485)

Purpose:

This statement maps, in pixels, the window of the world onto the screen. The first two numbers set the beginning and the end of the horizontal coordinates. The second two numbers set the beginning and the end of the vertical coordinates. Note that this is the mapping of the viewing frustrum, and it does not affect the area to be rendered as defined in the DEFINITION Section. The origin of the screen is the lower left hand corner.

Comments:

Starting version 7, the viewport information will be ignored. A viewport is automatically computed based on the information of the film back, film offset, and so on. If a viewport was used for partial image rendering, this is now easily specifiable in the interactive package without having to tweak with numbers.

Example:

viewport = (0, 319, 0, 239)

win_xsize

Syntax:

win_xsizet = <scalar>

Range:

unbounded

Default:

Not applicable - see below.

Purpose:

win_xsize defines the horizontal window size for orthographic rendering. The unit of measure is the unit of measure used for the grid in the Alias system; by default, centimeters.

Comments:

This component works only when perspective = FALSE.

Example:

win_xsize = 18.948872

win_ysize

Syntax:

win_ysizet = <scalar>

Range:

unbounded

Default:

Not applicable - see below.

Purpose:

win_ysize defines the vertical window size for orthographic rendering. The unit of measure is the unit of measure used for the grid in the Alias system; by default, centimeters.

Comments:

This component works only when perspective = FALSE.

Example:

win_ysize = 13.462891