title: OpenGL Perspective Projection: How to define left and right
body: <p>How do I set up coordinates for perspective matrix like in orthographic projection for left, right, top and bottom and add in fov and aspect ratio. I have only seen perspective matrix use other arguments in a method without left, right, bottom, top. This is my ortho matrix:</p>
  
  <pre class="lang-java prettyprint-override"><code>public static Matrix4f Orthographic(float left, float right, float bottom, float top, float near, float far) {
          Matrix4f result = Identity();
  
          result.elements[0 + 0 * 4] = 2.0f / (right - left);
  
          result.elements[1 + 1 * 4] = 2.0f / (top - bottom);
  
          result.elements[2 + 2 * 4] = 2.0f / (near - far);
  
          result.elements[0 + 3 * 4] = (left + right) / (left - right);
          result.elements[1 + 3 * 4] = (bottom + top) / (bottom - top);
          result.elements[2 + 3 * 4] = (far + near) / (far - near);
  
          return result;
      }
  </code></pre>
  
  <p>Now I want to create perspective one with same arguments but with added fov.</p>