Craft icon indicating copy to clipboard operation
Craft copied to clipboard

Matrix.h conversion from degrees to radians

Open mmhanson opened this issue 6 years ago • 1 comments

I'm reading through this project to help with my own OpenGL project and I noticed line 180 of matrix.c:

ymax = znear * tanf(fov * PI / 360.0);

Is fov in degrees? If so the correct way to convert it to radians would be:

ymax = znear * tanf(fov * PI / 180.0);

mmhanson avatar Dec 05 '19 19:12 mmhanson

Yes, FOV is in degrees. The argument passed to tanf is half of the FOV.

jtlehtinen avatar Jan 24 '22 20:01 jtlehtinen