Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Matrix4f getProjectionMatrix() {
- Matrix4f result = new Matrix4f();
- result.m[0][0] = 2.f / (right - left);
- result.m[0][1] = 0.0f;
- result.m[0][2] = 0.0f;
- result.m[0][3] = 0.0f;
- result.m[1][0] = 0.0f;
- result.m[1][1] = 2.f / (top - bottom);
- result.m[1][2] = 0.0f;
- result.m[1][3] = 0.0f;
- result.m[2][0] = 0.0f;
- result.m[2][1] = 0.0f;
- result.m[2][2] = -2.f / (far - near);
- result.m[2][3] = 0.f;
- result.m[3][0] = -(right + left) / (right - left);
- result.m[3][1] = -(top + bottom) / (top - bottom);
- result.m[3][2] = -(far + near) / (far - near);
- result.m[3][3] = 1;
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement