Viewer
A plugin-based viewer for learning Computer Graphics and OpenGL
Camera Class Reference

The Camera class represents a perspective camera.

#include <camera.h>

List of all members.

Public Member Functions

void init (const Box &b)
void setModelview () const
void setProjection () const
Point getObs () const
void setAspectRatio (float ar)
void updateClippingPlanes (const Box &)
void incrementDistance (float inc)
void incrementAngleX (float inc)
void incrementAngleY (float inc)
void pan (const Vector &offset)

Member Function Documentation

Point Camera::getObs ( ) const

Returns the camera (eye) position.

void Camera::incrementAngleX ( float  inc)

Rotates the camera by increasing the rotation angle around X axis (pitch). Then sets the GL_MODELVIEW matrix.

void Camera::incrementAngleY ( float  inc)

Rotates the camera by increasing the rotation angle around Y axis (yaw). Then sets the GL_MODELVIEW matrix.

void Camera::incrementDistance ( float  inc)

Moves the camera away (inc>0) or towards (inc<0) the current VRP. Then sets the GL_MODELVIEW matrix.

void Camera::init ( const Box b)

Initializes the camera parameters from a bounding box of the scene. The camera is placed outside the box, ensuring that the whole box fits within the viewing frustum. Then sets the GL_MODELVIEW and GL_PROJECTION matrices.

void Camera::pan ( const Vector offset)

Offsets the camera position and VRP. Then sets the GL_MODELVIEW matrix.

void Camera::setAspectRatio ( float  ar)

Sets the camera aspect ratio.

void Camera::setModelview ( ) const

Sets the GL_MODELVIEW matrix to the viewing transform represented by the camera.

void Camera::setProjection ( ) const

Sets the GL_PROJECTION matrix to the projection transform represented by the camera.

void Camera::updateClippingPlanes ( const Box box)

Recomputes the near, far clipping planes according to the given bounding box. Then sets the GL_PROJECTION matrix.


The documentation for this class was generated from the following files:
 All Classes Functions