SimpleGL  1.1.0
A framework for platform independent rendering
Static Public Member Functions | List of all members
sgl::Projection Class Reference

This class contains static methods to calculate projection matrices. More...

#include <transform.hpp>

Static Public Member Functions

static glm::mat4 identity ()
 Returns an identity matrix. More...
 
static glm::mat4 ortho (float left, float right, float bottom, float top, float zNear, float zFar)
 Calculates a transformation that produces a parallel projection. More...
 
static glm::mat4 frustum (float left, float right, float bottom, float top, float zNear, float zFar)
 Calculates a perspective matrix that produces a perspective projection. More...
 
static glm::mat4 perspective (float fovy, float aspect, float zNear, float zFar)
 Calculates a viewing frustum into the world coordinate system. More...
 

Detailed Description

This class contains static methods to calculate projection matrices.

Definition at line 271 of file transform.hpp.

Member Function Documentation

glm::mat4 sgl::Projection::frustum ( float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar 
)
static

Calculates a perspective matrix that produces a perspective projection.

Parameters
leftSpecify the coordinates for the left vertical clipping planes.
rightSpecify the coordinates for the right vertical clipping planes.
bottomSpecify the coordinates for the bottom horizontal clipping planes.
topSpecify the coordinates for the top horizontal clipping planes.
zNearSpecify the distances to the near depth clipping planes. Must be positive.
zFarSpecify the distances to the far depth clipping planes. Must be positive.
Returns
The calculated frustum projection matrix.

Definition at line 105 of file transform.cpp.

glm::mat4 sgl::Projection::identity ( )
static

Returns an identity matrix.

Returns
The identity matrix.

Definition at line 97 of file transform.cpp.

glm::mat4 sgl::Projection::ortho ( float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar 
)
static

Calculates a transformation that produces a parallel projection.

Parameters
leftSpecify the coordinates for the left vertical clipping planes.
rightSpecify the coordinates for the right vertical clipping planes.
bottomSpecify the coordinates for the bottom horizontal clipping planes.
topSpecify the coordinates for the top horizontal clipping planes.
zNearSpecify the distances to the nearer depth clipping planes. This value is negative if the plane is to be behind the viewer.
zFarSpecify the distances to the farther depth clipping planes. This value is negative if the plane is to be behind the viewer.
Returns
The calculated orthographic projection matrix.

Definition at line 101 of file transform.cpp.

glm::mat4 sgl::Projection::perspective ( float  fovy,
float  aspect,
float  zNear,
float  zFar 
)
static

Calculates a viewing frustum into the world coordinate system.

Parameters
fovySpecifies the field of view angle, in degrees, in the y direction.
aspectSpecifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
zNearSpecifies the distance from the viewer to the near clipping plane (always positive).
zFarSpecifies the distance from the viewer to the far clipping plane (always positive).
Returns
The calculated perspective matrix.

Definition at line 109 of file transform.cpp.


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