Functions | |
void | Set_Camera (const HC_POINT *position, const HC_POINT *target, const HC_VECTOR *up, double width, double height, const char *projection) |
void | DSet_Camera (const HCD_POINT *position, const HCD_POINT *target, const HCD_POINT *up, double width, double height, const char *projection) |
void | UnSet_Camera (void) |
void Set_Camera | ( | const HC_POINT * | position, |
const HC_POINT * | target, | ||
const HC_VECTOR * | up, | ||
double | width, | ||
double | height, | ||
const char * | projection | ||
) |
Allows the complete specification of the viewing camera's position, orientation, and field of view.
position | - Position in the scene, in user coordinates, at which to set up the camera. Passed by reference in all languages. |
target | - Coordinates in the scene at which to point the camera. Passed by reference in all languages. |
up | - Direction the top of the camera should face; the "up vector". Passed by reference in all languages. |
width | - Width of the minimum area around the target to be visible. |
height | - Height of the minimum area around the target to be visible. |
projection | - Special constant---either "Perspective", "Orthographic", "Stretched", or an "oblique" form (see Set_Camera_Projection() or Set_Camera_By_Volume() ). May be uppercase, lowe case, or mixed case. |
The "Camera" attribute is the generic attribute underlying Set_Camera_Position() , Set_Camera_Target() , Set_Camera_Up_Vector() , Set_Camera_Field() , and Set_Camera_Projection() . Those routines function by inquiring the details on the current camera, changing the single item of interest, and calling back to Set_Camera() to load everything back in. Set_Camera() would normally only be called directly if your program were keeping track of all the details of the camera, and you wanted to ensure that your program's opinion and the system's completely matched.
The field is stored as an angular field-of-view immediately upon receipt, and is held constant as an angle through subsequent camera movements. This keeps your lens from accidentally turning itself into a fish-eye as you walk up to your target.
If up is not already perpendicular to the specified line of sight, the nearest vector that is perpendicular is computed.
If the camera position is right on top of the camera target, or if the up vector is colinear with the line of sight, or if it is all zeroes, your camera setting isn't reasonable and errors are reported right away. (Since you've told the system about the camera all at once, the system doesn't bother to wait till Update time in the hopes that something will change. The individual routines---Set Position, Set Target, and Set Up Vector---will wait around.)
For historical reasons the words for the regular projections can be abbreviated. The oblique projections cannot be abbreviated.
The same camera must be in effect for light sources, for objects upon which the light falls, and for the window in which the lights and objects reside. (If one needs to rotate the lights with respect to the objects within the scene, or vice versa, Rotate_Object() rather than Orbit_Camera() should be used.)
void DSet_Camera | ( | const HCD_POINT * | position, |
const HCD_POINT * | target, | ||
const HCD_POINT * | up, | ||
double | width, | ||
double | height, | ||
const char * | projection | ||
) |
Similar to Set_Camera() but accepts double-precision values. This command can only be used when the application source includes the HOOPS double-precision header, hcd.h.
position | - Position in the scene, in user coordinates, at which to set up the camera. Passed by reference in all languages. |
target | - Coordinates in the scene at which to point the camera. Passed by reference in all languages. |
up | - Direction the top of the camera should face; the "upvec tor". Passed by reference in all languages. |
width | - Width of the minimum area around the target to be visible. |
height | - Height of the minimum area around the target to be visible. |
projection | - Special constant---either "Perspective", "Orthographic", "Stretched", or an "oblique" form (see Set_Camera_Projection() or Set_Camera_By_Volume() ). May be uppercase, lowe case, or mixed case. |
No additional details. See Set_Camera().
void UnSet_Camera | ( | void | ) |
Removes all settings established by a previous call to Set_Camera().
No additional details. See Set_Camera()