Presentation Matrix4f
This commit is contained in:
parent
202c141e4d
commit
565bc5edfe
@ -28,11 +28,11 @@ public class Matrix4f {
|
|||||||
public static Matrix4f orthographic(float left, float right, float bottom, float top, float near, float far){
|
public static Matrix4f orthographic(float left, float right, float bottom, float top, float near, float far){
|
||||||
Matrix4f result = identity();
|
Matrix4f result = identity();
|
||||||
|
|
||||||
result.elements[0] = 2.0f / (right - left);
|
result.elements[0 + 0 * 4] = 2.0f / (right - left);
|
||||||
result.elements[1 + 4] = 2.0f / (top - bottom);
|
result.elements[1 + 1 * 4] = 2.0f / (top - bottom);
|
||||||
result.elements[2 + 2 * 4] = 2.0f / (near - far);
|
result.elements[2 + 2 * 4] = 2.0f / (near - far);
|
||||||
|
|
||||||
result.elements[3 * 4] = (left + right) / (left - right);
|
result.elements[0 + 3 * 4] = (left + right) / (left - right);
|
||||||
result.elements[1 + 3 * 4] = (bottom + top) / (bottom - top);
|
result.elements[1 + 3 * 4] = (bottom + top) / (bottom - top);
|
||||||
result.elements[2 + 3 * 4] = (far + near) / (far - near);
|
result.elements[2 + 3 * 4] = (far + near) / (far - near);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user