dms::OrthoCamera

Source Code

Class Specification

#include <dms/OrthoCamera.h>

OrthoCamera(void);
OrthoCamera(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top,
            GLdouble near=-1, GLdouble far=1);
virtual void applyProjection(void) const;

void setEdges(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top,
            GLdouble near=-1, GLdouble far=1);
void setLeft(GLdouble);
void setRight(GLdouble);
void setBottom(GLdouble);
void setTop(GLdouble);
void setNear(GLdouble);
void setFar(GLdouble);
GLdouble left(void) const;
GLdouble right(void) const;
GLdouble bottom(void) const;
GLdouble top(void) const;
GLdouble near(void) const;
GLdouble far(void) const;

Description

OrthoCamera(void)
OrthoCamera(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top,
            GLdouble near, GLdouble far)

The default orthographic camera will cover the region (0, 0, -1) to (1, 1, 1); i.e., left will be 0, right 1, bottom 0, top 1, near -1, and far 1.
Example:

/* Make a '2D' projection covering (-10, 0) to (10, 5) */
dms::OrthoCamera ortho(-10, 10, 0, 5);
void applyProjection(void)

Loads an orthographic projection, using the camera's values, into the GL_PROJECTION matrix. This function is not normally called directly, but is used by Camera's apply() function.

void setEdges(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top,
            GLdouble near, GLdouble far)

Sets all of the values for the orthographic projection. The arguments are in the same order as those for glOrtho.
Example:

dms::OrthoCamera ortho;
ortho.setEdges(-10, 10, 0, 5, -1, 10);
void setLeft(GLdouble l)
void setRight(GLdouble r)
void setBottom(GLdouble b)
void setTop(GLdouble t)
void setNear(GLdouble n)
void setFar(GLdouble f)

Set the values for the orthographic projection individually.

GLdouble left(void)
GLdouble right(void)
GLdouble bottom(void)
GLdouble top(void)
GLdouble near(void)
GLdouble far(void)
 

Return the individual values for the orthographic projection.