2
\$\begingroup\$

I've built an application in SlimDX using an orbit camera. Currently I treat the position of the camera as a singular point in space. I've noticed my projections from 3D space to 2d space are off by a small amount. The further something is from the center of the view, the more the projection to 2D space is off.

Should I be thinking of the camera position as a point in space, or as a plane? Treating the camera as a plane would be conceptually similar to saying the lens of the camera has the same height & width as the view it observes.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ The plane interpretation is called Orthographic, the point interpretation is called Perspective. It depends on your projection matrix. \$\endgroup\$
    – MickLH
    May 20 '15 at 18:24
2
\$\begingroup\$

There are 2 main types of projections used in video games and 3d applications:

  1. Perspective
  2. Orthogonal

Perspective

This type of projection is the one that is the most commonly used to represent a 3d world simulation; it acts a little like a normal camera with lenses. All the elements of the scene are projected toward a single point, but drawn on a plane. In the case of computer 3d perspective projection, the plane is at the near clipping plane. On the camera, it is on the film or the photo-sensors (or whatever you call that device). The difference between the real world camera lenses and the 3d world projection is that the lenses distort the image circularly because of the shape of the lens, while the 3d version distort it linearly, because it's a straight matrix computation (the same matrix is used for all the vertices in the scene).

Orthogonal

This type of projection takes the vertices and brings them directly on the projection plane, there is no try in giving any effect at all. This kind of projection is mainly used for 2d interface, 2d games (made in 3d, like a side-scroller) and you can see it used a lot in CAD graphics tools as it does not distort sizes with depth.

So to answer your question, you most likely will treat your camera as a point in space that projects on a plane. Unfortunately, the distortion you see is "normal" (as in "expected") and there is very little you can do about it. What you see depends on the paramters you give it (field of view, aspect ration, near and far clipping planes; treat it as a pyramid with the top chopped off).

Depending on your application, you can try to use an orthographic camera but you will not get the same effect; you may also try to attenuate the effect by changing the field of view and/or the aspect ratio, but again, that might not help you.

A last suggestion I could give would be to attenuate it by doing a render to texture of your scene, apply that texture on a grid (mesh) model, modify the points of the vertices of the mesh to attenuate the distortion (you display that textured mesh instead of your scene); this would give a better or worse result, depending on your application.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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