19 float left,
float right,
float bottom,
float top,
float near_clip,
float far_clip)
21 float x_delta = right - left;
22 float y_delta = top - bottom;
23 float z_delta = far_clip - near_clip;
26 if (x_delta != 0.0f && y_delta != 0.0f && z_delta != 0.0f) {
27 mat[0][0] = 2.0f / x_delta;
28 mat[3][0] = -(right + left) / x_delta;
29 mat[1][1] = 2.0f / y_delta;
30 mat[3][1] = -(top + bottom) / y_delta;
31 mat[2][2] = -2.0f / z_delta;
32 mat[3][2] = -(far_clip + near_clip) / z_delta;
44 float left,
float right,
float bottom,
float top,
float near_clip,
float far_clip)
46 float x_delta = right - left;
47 float y_delta = top - bottom;
48 float z_delta = far_clip - near_clip;
51 if (x_delta != 0.0f && y_delta != 0.0f && z_delta != 0.0f) {
52 mat[0][0] = near_clip * 2.0f / x_delta;
53 mat[1][1] = near_clip * 2.0f / y_delta;
54 mat[2][0] = (right + left) / x_delta;
55 mat[2][1] = (top + bottom) / y_delta;
56 mat[2][2] = -(far_clip + near_clip) / z_delta;
58 mat[3][2] = (-2.0f * near_clip * far_clip) / z_delta;
78 tan(angle_left),
tan(angle_right),
tan(angle_bottom),
tan(angle_top), near_clip, far_clip);
79 mat[0][0] /= near_clip;
80 mat[1][1] /= near_clip;
float4x4 projection_perspective_fov(float angle_left, float angle_right, float angle_bottom, float angle_top, float near_clip, float far_clip)
Create a perspective projection matrix using OpenGL coordinate convention: Maps each axis range to [-...
float4x4 projection_orthographic(float left, float right, float bottom, float top, float near_clip, float far_clip)
Create an orthographic projection matrix using OpenGL coordinate convention: Maps each axis range to ...
float4x4 projection_perspective(float left, float right, float bottom, float top, float near_clip, float far_clip)
Create a perspective projection matrix using OpenGL coordinate convention: Maps each axis range to [-...
MatBase< float, 4, 4 > float4x4