mat4_t mat4_perspective(double fovy, double aspect, double near, double far, mat4_t dest) { double top = near * tan(fovy * M_PI / 360.0), right = top * aspect; return mat4_frustum(-right, right, -top, top, near, far, dest); }
mat4_t mat4_perspective(float fovy, float aspect, float near, float far, mat4_t dest) { float top = near * tan(fovy * M_PI / 360.0), right = top * aspect; return mat4_frustum(-right, right, -top, top, near, far, dest); }