Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

The question is pretty much in the title. Are there notable 3D projections other than orthographic and perspective that could be used in a 3D system such as OpenGL?

In particular, are there any that have a particular use in game design?

share|improve this question

closed as too broad by Josh Petrie Jun 22 at 21:52

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.

3 Answers 3

up vote 22 down vote accepted

Yes, To name a few:

The Pannini projection, for example, can capture wide fields of view in nice ways. (totally just my opinion)

I think implementation details would be beyond the scope of this specific question.


EDIT: Thanks for the comment, I did misspell Pannini. And to make this edit worthwhile here are a few more:

  • Paraboloid / Dual-Paraboloid (Useful for reflections, shadows, stained glass)
  • Equirectangular (Can produce a world map view of a sphere)
  • Spherical
  • Sinusoidal
share|improve this answer
4  
+1 for Panini projection; I hadn't ever heard of that one before. BTW, as long as we're talking non-linear projections, dual-paraboloid is one that's sometimes used for environment maps and shadow maps. –  Nathan Reed Jun 19 at 5:51
    
Being very picky, but it appears to be the "Pannini", not "Panini" projection. –  aardvarkk Jun 19 at 14:32
    
Very cool! I'm guessing these are all non-linear, like Nathan Reed says? –  jmite Jun 19 at 16:23
    
I believe so, you most likely have to use hardware tessellation or image processing to achieve them in practice. I'm having trouble thinking of another projection which maps straight lines into straight lines but I will add it to this answer if I come up with something. –  MickLH Jun 19 at 17:23
    
It probably doesn't exist, this is exactly the kind of think I was thinking of! –  jmite Jun 19 at 20:21

It depends on what you mean by "that could be used in a 3D system such as OpenGL". :)

Narrowly speaking, 3D graphics hardware and APIs like OpenGL only deal correctly with linear projections - projections that map straight lines in world space to straight lines on the image. They never distort something into a curved shape (unless it was curved to begin with). This is because GPUs depend on triangles having straight edges in order to rasterize them correctly on screen.

If we limit ourselves to linear projections, there aren't too many choices. In addition to the standard ortho and perspective, there are also "off-center" variations which are obtained by shearing the view frustum.

  • An off-center ortho projection is called oblique projection and is often used for engineering diagrams but doesn't show up much in games.
  • Off-center perspective projections are used in stereo 3D rendering, since it turns out that the left and right eye views fuse better in the brain if you shear the frustums instead of rotating them to focus on an object.

These projections can be represented with the usual 4×4 projection matrix and used in a 3D API without problems.

Then there are the nonlinear projections, which don't have the restriction of mapping straight lines to straight lines; they're allowed to distort things into curves. There are lots of these, including cylindrical, spherical, various types of fisheye, and others.

With nonlinear projections, you can't simply use a projection matrix; you have to somehow implement the projection yourself using shaders. One way is to write a custom vertex shader to do the projection per vertex. The GPU will still draw the triangle with straight lines between the vertices, so while small triangles will be pretty close to correct, larger triangles will be noticeably wrong. This can cause problems, and geometry may need to be subdivided very finely in order to render correctly.

A second approach to getting a nonlinear projection is to render the scene using a regular perspective projection first (maybe to a cubemap, which has a perspective projection for each cube face), then apply a post-process pixel shader to resample it to the desired nonlinear projection. This has the advantage of not requiring geometry modifications, but it can be more expensive due to the extra rendering work required, and the result can be blurry in some areas if the first-pass render doesn't have enough resolution. The post-process approach is used by Oculus Rift games, for example, to implement the nonlinear projection the Rift requires to work with its lenses.

share|improve this answer

I can't believe it but nobody has mentioned Isometric Projection which used to be quite common.

share|improve this answer
10  
As far as I know, isometric projections are specific use cases of the other two projection types, orthographic and perspective. For example a ortho projection with a view in a certain angle gives you an isometric camera. –  Grimshaw Jun 19 at 11:56

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