Presentation Matrix4f

This commit is contained in:
Antoine 2021-05-17 05:45:55 +02:00
parent 202c141e4d
commit 565bc5edfe

View File

@ -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);