Statics Methods Relevant to CameraBvr Objects

parallelCamera Creates a parallel camera for parallel (or orthographic) projection.
perspectiveCamera Creates a perspective camera for perspective rendering.

parallelCamera

Statics Class

Creates a parallel camera for parallel (or orthographic) projection. The parallel camera is transformed the same way as the perspective camera, except that z-scales have no effect (note, however, that zero or negative z-scales yield undefined results).

Prior to transformation, the parallel camera gazes in the negative z-direction, with positive y considered as "up."

Syntax

public static CameraBvr parallelCamera( NumberBvr nearclip );

Parameters

nearclip
NumberBvr object that is the z-location of the near clipping plane. This parameter can also be of type double.

Return Value

Returns the CameraBvr object.

perspectiveCamera

Statics Class

Creates a perspective camera for perspective rendering. On creation, the projection plane (the plane at which objects appear as their actual size) is located at Z=0, the projection point is located at [0 0 projdist], and the near clipping plane is located at [0 0 nearclip].

Syntax

public static CameraBvr perspectiveCamera( NumberBvr projdst, NumberBvr nearclip );

Parameters

projdst
NumberBvr object that is the z-location of the projection point. It must be greater than zero. This parameter can also be of type double.
nearclip
NumberBvr object that is the z-location of the near clipping plane. It must be less than projdst. This parameter can also be of type double.

Return Value

Returns the CameraBvr object.

Remarks

The projdst parameter specifies the distance between the projection plane and the projection point, and must be greater than zero. The smaller this distance, the more of a wide-angle effect is achieved. The larger this distance, the more of a telephoto effect is achieved.

The nearclip parameter specifies the z-location of the near clipping plane and must be less than projdst. In other words, the near clipping plane must lie on the same side of the projection point as the projection plane. Although it is tempting to place the near clipping plane as close as possible to the projection point, z-buffer precision is lost dramatically as the near clipping plane gets closer to the projection point. (The main result of such precision loss is that far objects are rendered in front of near objects.)

The following diagram shows a model of the perspective camera. Note that the nearclip need not be in front of the projection plane.

Perspective Camera


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