fov

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
jugurdzija
Posts: 26
Joined: Thu Feb 05, 2004 10:58 pm

fov

Post by jugurdzija »

i cant get that fov values right,45 is ok but when i increase it camera gets inverted...is that a bug?
Mercior
Posts: 100
Joined: Tue Feb 24, 2004 1:53 am
Location: UK
Contact:

Post by Mercior »

I think the fov value for cameras is in radians, ie: PI*(degrees/180)
Celebrandil
Posts: 1
Joined: Tue Mar 16, 2004 11:32 pm

Post by Celebrandil »

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;
Post Reply