makeFrustumMatrix function

Matrix4 makeFrustumMatrix(
  1. double left,
  2. double right,
  3. double bottom,
  4. double top,
  5. double near,
  6. double far
)

Constructs a new OpenGL perspective projection matrix.

left, right specify the coordinates for the left and right vertical clipping planes. bottom, top specify the coordinates for the bottom and top horizontal clipping planes. near, far specify the coordinates to the near and far depth clipping planes.

Implementation

Matrix4 makeFrustumMatrix(double left, double right, double bottom, double top,
    double near, double far) {
  final view = Matrix4.zero();
  setFrustumMatrix(view, left, right, bottom, top, near, far);
  return view;
}