Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. public Matrix4f getProjectionMatrix() {
  2.         Matrix4f result = new Matrix4f();
  3.  
  4.         result.m[0][0] = 2.f / (right - left);
  5.         result.m[0][1] = 0.0f;
  6.         result.m[0][2] = 0.0f;
  7.         result.m[0][3] = 0.0f;
  8.  
  9.         result.m[1][0] = 0.0f;
  10.         result.m[1][1] = 2.f / (top - bottom);
  11.         result.m[1][2] = 0.0f;
  12.         result.m[1][3] = 0.0f;
  13.  
  14.         result.m[2][0] = 0.0f;
  15.         result.m[2][1] = 0.0f;
  16.         result.m[2][2] = -2.f / (far - near);
  17.         result.m[2][3] = 0.f;
  18.  
  19.         result.m[3][0] = -(right + left) / (right - left);
  20.         result.m[3][1] = -(top + bottom) / (top - bottom);
  21.         result.m[3][2] = -(far + near) / (far - near);
  22.         result.m[3][3] = 1;
  23.  
  24.         return result;
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement