Hello Guest

Projection Matrix

  • 1 Replies

Offline pdid

  • *
  • 22
Projection Matrix
« on: January 23, 2017, 19:58:56 »
When using a projection matrix in OpenGL, the FOV can change depending on the aspect ratio of the window. For instance when I have a full screen game like this:
You can see the edge of the dragon's foot. Then in a smaller window like this:
The dragon's foot is not at all visible. I did not change the camera's location at all between the two images. Such a disparity in FOV's can lead to having a competitive advantage depending on how large your monitor is when playing an FPS. Does anyone know how the major FPS creators deal with this issue? Knowing how could help me implement it into my game. Thanks for any help in advance.


Offline bobjob

  • ****
  • 394
Re: Projection Matrix
« Reply #1 on: January 24, 2017, 07:52:03 »
Some games will force the player to have a fixed aspect ratio, other games will allow a dynamic aspect ratio.

This is something you need to decide first. Fps games that Im aware of have very low FOV values for 45-90 (90 being very high with modern widescreen monitors). if you want to want to take full advantage of widescreens then try use a small fov. This is a scenario where only testing the application at all sizes will allow you to determine what works best.

with older monitors 90 fov wasnt such a big issue, QuakeWorld had 90, and I would often turn it up on my old CRT. That's because screen resolution increases where usually always close to the same ratio, and most old games couldn't be resized.

So I would recommend developing your game at a FOV like 45, and resizing the screen to extremely wide view when making changes. no fixed aspect ratio means develop and test, develop and test. Once you are ready to release you can increase the fov to something like 60 as a default

The other issue you will face with screen resizing is the 2D ortho issues of having all the text in the screen. If a sentence can be viewed in widescreen once you resize it to portrait view, it may get squished and look silly. If you dont want it to squish, only half of it will appear. There is a few different solutions for this, though
« Last Edit: January 24, 2017, 08:05:53 by bobjob »