fov
-
- Posts: 26
- Joined: Thu Feb 05, 2004 10:58 pm
fov
i cant get that fov values right,45 is ok but when i increase it camera gets inverted...is that a bug?
-
- Posts: 1
- Joined: Tue Mar 16, 2004 11:32 pm
The FOV is obviously implemented backwards. I made the following changes to matrix4::buildProjectionMatrixPerspectiveFovLH() and got something that looks alright to me.
f32 w = 2.0 * (f32)(sin(fieldOfViewRadians/2) / cos(fieldOfViewRadians/2));
f32 h = w * aspectRatio;
(*this)(0,0) = 1.0/w;
(*this)(1,1) = 1.0/h;
f32 w = 2.0 * (f32)(sin(fieldOfViewRadians/2) / cos(fieldOfViewRadians/2));
f32 h = w * aspectRatio;
(*this)(0,0) = 1.0/w;
(*this)(1,1) = 1.0/h;