Classes derived from HT_Camera are able to specify the camera parameters by various independent subsets.
Note: All angles are specified in radians unless otherwise stated.
HT_Camera_Obliquity, HT_Camera_Field,
See HT_Camera parameters for synopses of these methods:
aspect_ratio
distance
eye_direction
field
horizontal_axis
obliquity
ortho_range, set_ortho_range
position
projection
projection_matrix
set_field
set_obliquity
set_position
set_projection
set_stretched
set_target
set_up_vector
set_wlimit
stretched
target
up_vector
viewing_axis
viewing_matrix
wlimit
dolly
orbit
pan
roll
zoom
HT_Camera
~HT_Camera
Orthographic projections linearly map the scene from ± ortho_range into the Z buffer. For example, ortho_range=4 will map the normalized range of Z values=(-4,4) to the Z buffer.
Perspective projections non linearly map the scene from normalized Z=(-1+wlimit) to Z=infinity. The mapping is given by Z`=Z/w. Since w=Z+1, this becomes Z`=Z/Z+1.
In figure 1, four intersecting values of Z are noted: Z=-1 (the camera position), Z=-1+wlimit (the fore clipping plane), Z=0 (the view target), and Z=infinity.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Purpose
virtual float aspect_ratio (void) const
double aspect_ratio_d (void) const
virtual float distance (void) const
double distance_d (void) const
HT_Vector const & eye_direction (void) const
HT_Vector_D eye_direction_d (void) const
HT_Camera_Field const & field (void) const
HT_Camera_Field_D field_d (void) const
virtual HT_Vector const horizontal_axis (void) const
HT_Vector_D horizontal_axis_d (void) const
HT_Camera_Obliquity const & obliquity (void) const
HT_Camera_Obliquity_D obliquity_d (void)
float ortho_range(void) const
HT_Point const & position (void) const
HT_Point_D position_d (void) const
HT_Camera_Projection const & projection (void) const
HT_Matrix HT_Camera::projection_matrix (void) const
HT_Boolean stretched (void) const
HT_Point const & target (void) const
HT_Point_D target_d (void) const
HT_Vector const & up_vector (void) const
HT_Vector_D up_vector_d (void)
HT_Vector const & viewing_axis (void) const
HT_Vector_D viewing_axis_d (void) const
HT_Matrix HT_Camera::viewing_matrix (void) const
float wlimit (void) const
void set_field (HT_Camera_Field const & fld)
void set_field (HT_Camera_Field_D const & fld)
void set_obliquity (HT_Camera_Obliquity const & obl)
void set_obliquity (HT_Camera_Obliquity_D const & obl)
void set_ortho_range (float range) alter;
void set_position (HT_Point const & pos)
void set_position (HT_Point_D const & pos)
void set_projection (HT_Camera_Projection proj)
void set_stretched (HT_Boolean str)
void set_target (HT_Point const & tar)
void set_target (HT_Point_D const & tar)
void set_up_vector (HT_Vector const & up)
void set_up_vector (HT_Vector_D const & up)
void set_wlimit (float w)
distance gives the distance between camera target and camera position in World space units.
field.x and field.y give the dimensions of the view rectangle in World space units. The view rectangle is centered on target in the XY plane.
obliquity measures the amount that the Z axis is rotated from the perpendicular to the image plane. obliquity.x gives the rotation angle about the Y axis and obliquity.y the angle of rotation about the X axis.
position is the projection center in the case of perspective projection; the line joining position with target gives the projection direction in the case of parallel projection.
projection is one of the enumerated values perspective, parallel.
stretched indicates whether the mapping between the field rectangle and the screen viewport is isotropic (stretched == HK_False) or anisotropic (stretched == HK_True).
target is the center of the camera coordinate system, expressed with respect to World Coordinates. It lies on the image plane at the center of the view rectangle.
up is a vector whose projection on the image plane defines the view-up direction. The view-right direction is defined by the projection of a vector perpendicular to up and the view axis.
Note: Methods followed by an _d are double precision and are similar in functionality to the 32 bit versions¾for example aspect_ratio_d or obliquity_d.
For more information about cameras and viewing parameters,
see the section "Camera
Classes," in chapter 2, "Heidi Architecture."
Purpose
void dolly (HT_Vector const & d)
void dolly (double x, double y, double z)
void dolly (float x, float y, float z)
void dolly (HT_Vector_D const & d)
In the first form, the distance is specified as a vector. In the second form, each component is specified separately. Positive values move the camera right, up, and in.
For information about "walking around" an object that
you are continuously looking at, see camera control, orbit.
For information about looking in a different direction, without changing
the camera position, see pan (in the same location).
For information about "focusing in" on an object without changing the camera
position, see zoom (also in the same location).
Purpose
HT_Camera ()
HT_Camera (HT_Camera const & cam)
projection = perspective stretched = false target = (0, 0, 0) position = (0,0,-5) ortho_range = 4 wlimit = 0.05 horizontal = (1, 0, 0) up_vector = (0, 1, 0) eye = (0, 0, 1) distance = 5 field = (2, 2) obliquity = (0, 0)The second form, HT_Camera (HT_Camera const & cam) , makes the new camera object¾ initially a copy of cam.
Purpose
~HT_Camera ()
Purpose
void orbit (float x, float y)
void orbit (double x, double y)
The x parameter specifies the angle, in radians, that the camera should "walk around" the target to the right. This value can be negative. The y parameter specifies the angle, in radians, that the camera should float up and over the target. This value can also be negative.
The second form is for double precision.
For information about moving the camera position and camera target by equal distances, see camera control, dolly. For information about looking in a different direction, but not changing the camera position,, see pan (in this class). For information about "focusing in" on an object without changing the camera position, see zoom (also in this class).
Purpose
void pan (float x, float y)
void pan (double x, double y)
The x parameter specifies the angle, in radians, that the camera should sweep to the right. This value can be negative (sweep to the left). The y parameter specifies the angle, in radians, that the camera tilts upward. This value can also be negative (downward).
The second form is for double precision.
For information about moving the camera position and camera target by equal angles, see camera control, dolly. For information about "walking around" an object that you are continuously looking at, see orbit (in this class). For information about "focusing in" on an object without changing the camera position, see zoom (also in this class)).
Purpose
void roll (float angle)
void roll (double angle)
The angle specifies the amount of roll. A positive angle rolls the camera counter-clockwise; the scene appears to roll by clockwise. To roll in the opposite direction, specify a negative angle.
The second form is for double precision.
Purpose
void zoom (float factor)
void zoom (double factor)
The factor parameter specifies the relative change in width of the field of view. A factor of 2 zooms in until the viewing field is half its previous size.
The second form is for double precision.
For information about moving the camera position and camera target by equal distances, see camera control, dolly. For information about "walking around" an object that you are continuously looking at, see orbit (in this class). For information about looking in a different direction, but not changing the camera position, see pan (also in this class).