FOV bug?

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Mobius
Posts: 14
Joined: Sun Dec 18, 2005 3:16 pm

FOV bug?

Post by Mobius »

I think that the FOV in buildProjectionMatrixPerspectiveFovLH/RH
methods are wrong calculated.

In fact, if I restrict the field of view I obtain a zoom out, not a zoom in.
I also tried a patch found at hybryd page, but it doesn't work.

Then I looked the GLUPerspective function:
http://developer.apple.com/documentatio ... ive.3.html

If I use

(*this)(0,0) = h / aspectRatio;
(*this)(1,1) = h;

instead of the original settings, FOV seems to work.

Is it a bug?
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

I believe Rv had it right here http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=12426. This is the projection matrix code Lightfeather uses, and it seems to work well
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
Mobius
Posts: 14
Joined: Sun Dec 18, 2005 3:16 pm

Post by Mobius »

Ok, that confirms my version... thanks!
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

The Irrlicht one works fine for me, If I use that one from that post, my FOV gets all screwed up and everything looks elongated.
Image
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

Using Rv's version a normal FOV is pi/3 rad (60 degrees) instead of pi/2 rad (90 degrees). That should look fine. Rv's version doesn't go crazy when you move the near plane, which the original version does.
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, both DirectX and OpenGL used something like this, so I have changed all 6 projection matrices to the DirectX default from MSDN. Please try this version (e.g. by copying matrix4.h from SVN to your code or directly using SVN) and report problems back.
The strange aspect ratio was due to a "fix" for the corrected aspect ratio several versions ago. We had to multiply with the aspect ratio to get the Irrlicht matrices working correctly. However, now this had to be changed back :wink:
Post Reply