DACamera Class

Creates a DACamera object that represents a camera behavior (a camera whose values can be animated, or vary over time). A camera is used with the Render function to project geometry onto an infinite two-dimensional image. Related operations include rendering it into a microphone to extract the sound, or into a pair of microphones to extract stereo sounds.

There are two basic types of cameras: one for parallel projection and one for perspective projection. Both cameras are oriented so that they gaze in the negative z-direction, with positive y-axis considered "up." Also, both cameras have a near clipping plane. This plane (a product of Z-buffered rendering) specifies the closest distance at which an object is visible. Objects closer than the near clipping plane cannot be seen.

Cameras are manipulated via standard three-dimensional transform operations. These transforms modify the camera characteristics and also position and orient the cameras. For more information about these operations, see the transform functions described below.

This class inherits from DABehavior.

For relevant functions in the DAStatics class, see DAStatics Functions Relevant to DACamera Objects.

DACamera Functions

Depth Creates a new DACamera object by applying the specified depth to the original object. Same as DepthAnim except that d is a nonanimated number (a double).
DepthAnim Creates a new DACamera object by applying the specified depth to the original object.
DepthResolution Creates a new DACamera object by applying the specified depth resolution (res) to the original behavior. Same as DepthResolutionAnim except that res is a nonanimated number (a double).
DepthResolutionAnim Creates a new DACamera object by applying the specified depth resolution (res) to the original behavior.
TransformUsed to modify, position, and orient a camera.

Depth

DACamera Class

Creates a new DACamera object by applying the specified depth to the original object. Same as DepthAnim except that d is a nonanimated number (a double).

Syntax

cameraObj.Depth( d )

Parameters

d
A double value that sets the maximum viewing depth of the DACamera. This is a nonanimated number.

Return Value

Returns the DACamera object.

DepthAnim

DACamera Class

Creates a new DACamera object by applying the specified depth to the original object. By default, cameras have infinite depth, which means that all objects in front of the camera are visible. The new object is a DACamera whose maximum viewing depth is the DANumber depth. If depth < 0, the camera will be unable to see anything. If you prefer to think in terms of hither and yon, this function sets yon = hither + depth. It is important to note that depth is the limit on the far plane. As with the near plane, the geometry is bounded as tightly as possible for maximum Z-resolution.

Limiting the depth of the camera is useful for preserving depth resolution when using Z-buffered rendering. It is also useful for a camera inside a building, where no viewing region is larger than some value.

Syntax

cameraObj.DepthAnim( d )

Parameters

d
DANumber object that sets the maximum viewing depth of the DACamera. This value must be an animated number.

Return Value

Returns the DACamera object.

DepthResolution

DACamera Class

Creates a new DACamera object by applying the specified depth resolution (res) to the original behavior. Same as DepthResolutionAnim except that res is a nonanimated number (a double).

Syntax

cameraObj.DepthResolution( res )

Parameters

res
A double value that sets the minimum depth (in camera coordinates) that is guaranteed to be distinct. This is a nonanimated number.

Return Value

Returns the DACamera object.

Remarks

The z-buffered rendering approach assigns one depth-value to each pixel on the screen. Typically, this is one of 65,536 possibilities. The depth resolution is the minimum distance between two objects that still appear distinct. This resolution decreases as you go from the near clipping plane to the far clipping plane, depending on the amount of perspective for the given camera.

DepthResolutionAnim

DACamera Class

Creates a new DACamera object by applying the specified depth resolution (res) to the original behavior.

Syntax

cameraObj.DepthResolutionAnim( res )

Parameters

res
DANumber object that sets the minimum depth (in camera coordinates) that is guaranteed to be distinct. This value must be an animated number.

Return Value

Returns the DACamera object.

Remarks

The z-buffered rendering approach assigns one depth-value to each pixel on the screen. Typically, this is one of 65,536 possibilities. The depth resolution is the minimum distance between two objects that still appear distinct. This resolution decreases as you go from the near clipping plane to the far clipping plane, depending on the amount of perspective for the given camera. DepthResolutionAnim adjusts the far clipping plane, according to the minimum depth to be observed for the entire visible space.

For example, if the projection point is at (0, 0, 2), the image plane is at (0, 0, 1), and the depth resolution is set to 1 centimeter, then the resultant DACamera will have a viewing depth of slightly over 25.1 meters. It is important to note that depth represents the limit on the far plane. As with the near plane, the geometry will actually be bounded as tightly as possible for maximum z-resolution. See Rendering Geometries into Images for a diagram of the near clipping plane and image plane.

Transform

DACamera Class

Modifies, positions, and orients the DACamera object.

Syntax

cameraObj.Transform( xf )

Parameters

xf
DATransform3 object used to create a new camera.

Return Value

Returns the DACamera object.

Remarks

The transform applied to the camera can be a single transform or a combination of transforms. Scale transforms modify the camera, while translations and rotations position and orient the camera.

All camera scales should be applied before camera rotations. Only scales, rotations, and translations are supported on cameras. Transformations that do not meet these criteria will yield a camera with an undefined behavior.

There are two types of scale transformations, called Z-scales and X/Y-scales. Z-scales must be positive, nonzero values. Z-scales affect the position of the near clipping plane (if the clipping plane is set to a nonzero value.) For example, if the near clipping plane is located at 10 (that is, if Z = 10), then a scale of [1 1 3] will yield a near clipping plane located at Z = 30. More importantly, Z-scales move the projection point for a perspective camera. This means an increasing Z-scale yields a perspective camera that is zooming in, and a decreasing Z-scale yields a perspective camera that is zooming out.

Use X/Y-scales to affect the size of the projected image. One way to think of this is that an X/Y-scale sets the size of the camera relative to the world it's viewing. For example, if you are viewing a microscopic scene, use a small X/Y-scale. On the other hand, if you are viewing a solar system, use a large X/Y scale. Scaling a camera by some value in X/Y is exactly equivalent to inversely scaling the resulting image by the same amount. For example, scaling the camera by [10 10 1] is the same as scaling the resulting image by [1/10 1/10]. Finally, disparate scales in X and Y can be used to change the aspect ratio of the rendered image.

Once the camera is defined (via construction and scaling), it can be placed in the scene via rotations and translations just as a light source, microphone, or any other geometric object is placed.

This function composes values. The resulting transformation is the new value applied to the old value.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.