Main Page   Class Hierarchy   Compound List   Compound Members  

Producer::Camera::Lens Class Reference

A Lens provides control over the PROJECTION matrix. More...

Inheritance diagram for Producer::Camera::Lens:

Producer::Referenced List of all members.

Public Types

enum  Projection { Perspective, Orthographic }

Public Methods

 Lens ()
void setPerspective (double hfov, double vfov, double nearClip, double farClip)
void setFrustum (double left, double right, double bottom, double top, double nearClip, double farClip)
void setOrtho (double left, double right, double bottom, double top, double nearClip, double farClip)
bool convertToOrtho (float d)
bool convertToPerspective (float d)
void apply (float xshear=0.0f, float yshear=0.0)
void generateMatrix (float xshear, float yshear, Matrix::value_type matrix[16])
Projection getProjectionType () const
void getParams (double &left, double &right, double &bottom, double &top, double &nearClip, double &farClip)
float getHorizontalFov () const
float getVerticalFov () const
void setAutoAspect (bool ar)
bool getAutoAspect () const
void setAspectRatio (double aspectRatio)
double getAspectRatio ()

Protected Methods

 ~Lens ()

Detailed Description

A Lens provides control over the PROJECTION matrix.

It is entirely contained within the Camera class. A Lens may be of type Perspective or Orthographic and set with one of the setFrustum, setProjection() or setOrtho(). The Lens type is implied by the method used to set it


Member Enumeration Documentation

enum Producer::Camera::Lens::Projection
 

Projection types


Member Function Documentation

void Producer::Camera::Lens::apply float    xshear = 0.0f,
float    yshear = 0.0
 

apply the lens. This generates a projection matrix for OpenGL

bool Producer::Camera::Lens::convertToOrtho float    d
 

convertToOrtho() converts the current perspective view to an orthographic view with dimensions that conserve the scale of the objects at distance d. convertToPerspective() converts the current orthographic view to a perspective view with parameters that conserve the scale of objects at distance d.

void Producer::Camera::Lens::setFrustum double    left,
double    right,
double    bottom,
double    top,
double    nearClip,
double    farClip
 

Set the Projection type to be of Perspective and provide the dimensions of the left, right, bottom, top, nearClip and farClip extents of the viewing frustum as indicated. xshear- Assymetrical shear in viewing frustum in the horizontal direction. Value given in normalized device coordinates (see setShear() below). yshear- Assymetrical shear in viewing frustum in the vertical direction. Value given in normalized device coordinates (see setShear() below).

void Producer::Camera::Lens::setOrtho double    left,
double    right,
double    bottom,
double    top,
double    nearClip,
double    farClip
 

Set the Projection type to be of Orthographic and provide the left, right, bottom dimensions of the 2D rectangle

void Producer::Camera::Lens::setPerspective double    hfov,
double    vfov,
double    nearClip,
double    farClip
 

Set the Projection type to be of Perspective and provide the following parameters to set the Projection matrix. hfov - Horizontal Field of View in degrees vfov - Vertical Field of View in degrees nearClip - Distance from the viewer to the near plane of the viewing frustum. farClip - Distance from the viewer to the far plane of the viewing frustum. xshear- Assymetrical shear in viewing frustum in the horizontal direction. Value given in normalized device coordinates (see setShear() below). yshear- Assymetrical shear in viewing frustum in the vertical direction. Value given in normalized device coordinates (see setShear() below).


The documentation for this class was generated from the following file:
Generated on Tue Aug 24 15:21:44 2004 for OpenProducer by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002