SpiecsEngine
 
Loading...
Searching...
No Matches

◆ OtrhographicMatrix()

glm::mat4 Spices::OtrhographicMatrix ( float left,
float right,
float top,
float bottom,
float nearPlane,
float farPlane )

Calculate Otrhographic Matrix.

Parameters
[in]left.
[in]right.
[in]top.
[in]bottom.
[in]nearPlane.
[in]farPlane.
Returns
Returns Otrhographic Matrix.

Definition at line 114 of file Math.cpp.

115 {
116 glm::mat4 mat = glm::mat4{ 1.0f };
117 mat[0][0] = 2.0f / (right - left);
118 mat[1][1] = 2.0f / (bottom - top);
119 mat[2][2] = 1.0f / (farPlane - nearPlane);
120 mat[3][0] = -(right + left) / (right - left);
121 mat[3][1] = -(bottom + top) / (bottom - top);
122 mat[3][2] = -nearPlane / (farPlane - nearPlane);
123
124 return mat;
125 }