Projection transformations are used to map object coordinates to window
coordinates for two-dimensional display devices.
Each
SG_Camera instance is associated with a projection transformation.
void SG_CameraGetProjection (SG_Camera *cam, M_Matrix44 *P)
void SG_CameraSetOrthographic (SG_Camera *cam)
void SG_CameraSetPerspective (SG_Camera *cam, M_Real fov, M_Real aspect)
void SG_CameraSetUser (SG_Camera *cam, const M_Matrix44 *Pleft, const M_Matrix44 *Pright)
void SG_CameraSetClipPlanes (SG_Camera *cam, M_Real near, M_Real far)
void SG_CameraSetBackPolyMode (SG_Camera *cam, const SG_CameraPolyMode *polymode)
void SG_CameraSetFacePolyMode (SG_Camera *cam, const SG_CameraPolyMode *polymode)
|
The
SG_CameraGetProjection() function returns the current projection matrix of
cam into
P.
The
SG_CameraSetOrthographic() function sets the projection matrix of
cam to an orthographic projection matrix.
SG_CameraSetPerspective() selects a perspective matrix.
For perspective projections,
aspect defines the aspect ratio (ratio of width to height) and
fov defines the field-of-view angle in degrees in the y direction.
The
SG_CameraSetUser() function sets the projection matrix of
cam to user-specified matrices
Pleft (left eye) and
Pright (right eye).
Unless stereo rendering is activated, only
Pleft is used.
The near and far clipping planes are defined by
SG_CameraSetClipPlanes(). near and
far represent the distance from the standard XY plane to the near and far clipping
planes.
SG_CameraSetBackPolyMode() and
SG_CameraSetFacePolyMode() configure the way back-facing or front-facing polygons are rendered by
views using this camera.
The structure is defined as:
typedef struct sg_camera_polymode {
enum {
SG_CAMERA_POINTS, /* Render as points */
SG_CAMERA_WIREFRAME, /* Render in wireframe */
SG_CAMERA_FLAT_SHADED, /* Flat-shaded */
SG_CAMERA_SMOOTH_SHADED /* Smooth-shaded */
} mode;
int cull; /* Cull entirely */
} SG_CameraPolyMode;
|
|