mat4.perspective require radians, not degrees
owmo-dev opened this issue · comments
Owen Moore commented
When adjusting the fov in ch04_06_projection-modes.html the viewport "flips" all over the place. It looks like the perspective function used in glmatrix library requires radians as input, not degrees as used in the code.
https://glmatrix.net/docs/module-mat4.html
let fov = 45
mat4.perspective(projectionMatrix, fov, width / height, 1, 5000);
Should be:
let fov = 45
mat4.perspective(projectionMatrix, fov * (Math.PI / 180), width / height, 1, 5000);