This is a simplified version of the perspective projection matrix, where we assume right-left and up-down symmetry in the view frustum.
121 function generatePerspectivematrix(x_scale, y_scale, z_near, z_far) 122 { 123 return new Float32Array([z_near/x_scale, 0.0, 0.0, 0.0, 124 0.0, z_near/y_scale, 0.0, 0.0, 125 0.0, 0.0, -(z_far+z_near)/(z_far-z_near), -1.0, 126 0.0, 0.0, -2*z_far*z_near/(z_far-z_near), 0.0]); 127 }
At first glance, this code might not match the the full projection matrix from the online references.
Me make significant simplifications using top-bottom and left-right symmetry.
and
Substituting these values into the full matrix gives the much simpler version used in the code.