Structs



TQ3CameraData


typedef struct TQ3CameraData {
    TQ3CameraPlacement                          placement;
    TQ3CameraRange                              range;
    TQ3CameraViewPort                           viewPort;
} TQ3CameraData;
Discussion

Describes the common state for a camera.

The common camera state includes its position and orientation within the world (placement), the near and far clipping planes (range), and the current viewport.

Field Descriptions
placement
The position and orientation of the camera.
range
The near and far clipping planes of the camera.
viewPort
The viewport for the camera.

TQ3CameraPlacement


typedef struct TQ3CameraPlacement {
    TQ3Point3D                                  cameraLocation;
    TQ3Point3D                                  pointOfInterest;
    TQ3Vector3D                                 upVector;
} TQ3CameraPlacement;
Discussion

Describes the location and orientation of a camera. All points are in world-space coordinates.

Field Descriptions
cameraLocation
The location of the camera.
pointOfInterest
The point at which the camera is aimed.
upVector
The up vector for the camera. This vector must be normalised and perpendicular to the viewing direction of the camera. This vector is transformed to the y axis of the viewing plane.

TQ3CameraRange


Describes the hither and yon clipping planes of a camera.
typedef struct TQ3CameraRange {
    float                                       hither;
    float                                       yon;
} TQ3CameraRange;
Discussion

Objects closer than the hither distance or farther than the yon distance will be clipped, i.e., invisible, so you usually want hither to be closer than any object and yon to be farther than any object.

The hither and yon values, together with the bit depth of your depth buffer, determine how small a difference in depths can be resolved. It is more important to make hither as large as possible than to make yon as small as possible.

Field Descriptions
hither
The distance from the camera to the near clipping plane. This value must always be greater than 0.
yon
The distance from the camera to the far clipping plane. This value must always be greater than the hither field, and is allowed to be INFINITY.

TQ3CameraViewPort


typedef struct TQ3CameraViewPort {
    TQ3Point2D                                  origin;
    float                                       width;
    float                                       height;
} TQ3CameraViewPort;
Discussion

Describes the viewport for a camera.

The camera viewport is the rectangular area of the view plane which is mapped to the rendered area of the current draw context. The default mapping is a square of size 2.0x2.0, with the top left corner anchored at {-1.0, 1.0}.

By adjusting the viewport, it is possible to control which area of the camera's view is rendered (e.g., to divide an image into a series of horizontal strips for printing).

Field Descriptions
origin
The origin for the viewport.
width
The width of the viewport.
height
The width of the viewport.

TQ3OrthographicCameraData


typedef struct TQ3OrthographicCameraData {
    TQ3CameraData                               cameraData;
    float                                       left;
    float                                       top;
    float                                       right;
    float                                       bottom;
} TQ3OrthographicCameraData;
Discussion

Describes the state for an orthographic camera.

An orthographic camera is defined by four view planes, which form a box aligned with the camera view direction. These planes are defined by distances relative to the coordinate system formed by the camera location and its view direction.

Field Descriptions
cameraData
The common state for the camera.
left
The left side of the view volume.
top
The top side of the view volume.
right
The right side of the view volume.
bottom
The bottom side of the view volume.

TQ3ViewAngleAspectCameraData


typedef struct TQ3ViewAngleAspectCameraData {
    TQ3CameraData                               cameraData;
    float                                       fov;
    float                                       aspectRatioXToY;
} TQ3ViewAngleAspectCameraData;
Discussion

Describes the state for a traditional perspective camera.

A view angle aspect camera is a perspective camera defined by a field of view angle and an aspect ratio.

The field of view angle must be a positive angle in radians. If the aspect ratio is greater than 1.0, the field of view represents the vertical range of visibility, and if the aspect ratio is less than 1.0, the field of view is horizontal. In other words, the field of view is the smaller of the two angles.

Field Descriptions
cameraData
The common state for the camera.
fov
The field of view of the camera, in radians.
aspectRatioXToY
The horizontal-to-vertical aspect ratio of the camera.

TQ3ViewPlaneCameraData


typedef struct TQ3ViewPlaneCameraData {
    TQ3CameraData                               cameraData;
    float                                       viewPlane;
    float                                       halfWidthAtViewPlane;
    float                                       halfHeightAtViewPlane;
    float                                       centerXOnViewPlane;
    float                                       centerYOnViewPlane;
} TQ3ViewPlaneCameraData;
Discussion

Describes the state for a view plane camera.

A view plane camera is a perspective camera which allows the specification of an off-center viewing frustum.

The frustum is formed by following the camera view direction for a given distance, then taking the specified rectangle on that plane. The frustum extends from the camera position through the four edges of this rectangle.

Field Descriptions
cameraData
The common state for the camera.
viewPlane
The distance from the camera to the view plane.
halfWidthAtViewPlane
The half-width of the rectangle on the view plane.
halfHeightAtViewPlane
The half-height of the rectangle on the view plane.
centerXOnViewPlane
The x-center of the rectangle on the view plane.
centerYOnViewPlane
The y-center of the rectangle on the view plane.

© 1999-2008 Quesa Developers (Last Updated 5/10/2008)