Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Many games do just fine with two projections, that can be represented by a matrix (orthographic and linear perspective). But what about projections that can't be represented by a matrix? Can you please provide some examples of such projections and why they might be used in a game application?

share|improve this question

closed as too broad by Josh Petrie Jun 21 '14 at 22:17

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

So you're saying tell me everything that isn't X? Pretty broad question. I find that I only need two projection matrix types. One based on having a camera with a variable FOV, and another that is orthographic. – badweasel Jun 21 '14 at 20:25
@badweasel Yeah, me likewise, but there are probably infinitely many such projections and I just want some examples, the more notable ones. – user1095108 Jun 21 '14 at 20:31
Please do not use moderator flags to request a question be re-opened. Editing a question already puts it back into the re-open queue for the community to vote on. – Josh Petrie Jun 22 '14 at 20:08
@JoshPetrie This is what moderator flags are for. First the flag, then the meta-site. – user1095108 Jun 22 '14 at 20:13
@JoshPetrie here's something for your reading pleasure. Obviously you were wrong, but you're more concerned about me raising the flag again. – user1095108 Jun 22 '14 at 20:23
up vote 1 down vote accepted

Cameras used in graphics applications are most of the time orthographic or mimic a pinhole camera. Both can be represent by a 4*4 matrix. A special variant would be a camera used for 3D rendering where the optical axis is not in the middle of the resulting image (e.g. parallel shift 3D) - but even they can be represented as a 4*4 matrix.

Real camera lenses however can work differently (fisheye lenses) or even tho they are designed to mimic a pinhole, they introduce (unintentionally) a pincushion or barrel distortion. These more exact models are used in computer vision (see for example bundler: ).

If a game wants to mimic real lenses and those effects, it should do so as a post-processing pass in a fragment shader as straight lines should get "bended" and only projecting the vertices correctly (and not the fragments that get generated as rasterization later) will introduce artefacts.

The only example I'm aware of where such a distortion is used in games is the pre-distortion in Oculus Rift games to counter the real-world lens distortion of the HMD. But here it can be handled by the SDK and also is not a property of the games camera so it should not be a property of the camera class.

tl;dr: Unless you plan a photography oriented game with perfectly realistic (fisheye) lenses, you can stick with a 4*4 matrix.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.