Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglOrthographicCamera Class Reference

#include <sglOrthographicCamera.hpp>

Inheritance diagram for sglOrthographicCamera::

sglCamera sglObject List of all members.

Public Methods

 sglOrthographicCamera ()
virtual ~sglOrthographicCamera ()
void setOrtho (double left, double right, double bottom, double top, double near_clip=-1.0, double far_clip=1.0)
void getOrtho (double &left, double &right, double &bottom, double &top, double &near_clip, double &far_clip) const
virtual void applyProjection () const
virtual void printInfo (ostream &ostrm, const char *indent_string) const

Protected Methods

 sglOrthographicCamera (const sglOrthographicCamera &)
sglOrthographicCamera& operator= (const sglOrthographicCamera &)
void buildFrustum ()

Protected Attributes

double m_left
double m_right
double m_bottom
double m_top

Detailed Description

This subclass of sglCamera is used to specify an orthographic projection parameters and view frustum. The parameters of the sglOrthographicCamera::setOrtho(..) member function are the same as those for OpenGL's glOrtho command. This class is usually assigned to an sglViewPlatform node to place and orient the camera in the 3D scene.


   sglOrthographicCamera *view_camera = new sglOrthographicCamera;
   view_camera->setOrtho(-10.0, 10.0, -8.0, 8.0, 1.0, 200.0);

   // OR (sets near/far to -1.0, 1.0)
   view_camera->setOrtho(-10.0, 10.0, -8.0, 8.0);

Definition at line 50 of file sglOrthographicCamera.hpp.

Constructor & Destructor Documentation

sglOrthographicCamera::sglOrthographicCamera ( )

default constructor.

sglOrthographicCamera::~sglOrthographicCamera ( ) [virtual]

virtual destructor.

Member Function Documentation

void sglOrthographicCamera::setOrtho ( double left,
double right,
double bottom,
double top,
double near_clip = -1.0,
double far_clip = 1.0 )

Set the orthographic projection parameters. These are the same as the arguments to the glOrtho command. The lower left and upper right positions on the near clip plane are defined as (left, bottom, -near) and (right, bottom, -near). The eyepoint position is at the origin. Default values of -1 and 1 for near_clip and far_clip allow this function to behave like gluOrtho2D if the user omits these two parameters.

left   Left edge of the frustum. The default is -10.
right   Right edge of the frustum. The default is 10.
bottom   Bottom edge of the frustum. The default is -10.
top   Top edge of the frustum. The default is 10.
near_clip   The near clip plane distance. Defaults to 0.1.
far_clip   The far clip plane distance. Defaults to 1000.0.

void sglOrthographicCamera::getOrtho ( double & left,
double & right,
double & bottom,
double & top,
double & near_clip,
double & far_clip ) const

Query the current orthographic parameters. The user passes in references to doubles to get the values.

virtual void sglOrthographicCamera::applyProjection ( ) const [virtual]

Setup the OpenGL projection matrix to match the specified frustum. This function leaves the glMatrixMode(GL_PROJECTION) in effect (current) upon return.

Reimplemented from sglCamera.

virtual void sglOrthographicCamera::printInfo ( ostream & ostrm,
const char * indent_string ) const [virtual]

Output the state of this node to the specified ostream.

ostrm   the ostream to which the output is sent
indent_string   the string (usually spaces) that is output at the beginning of every line of output

Reimplemented from sglCamera.

The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:09 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001