1
$\begingroup$

Simple perspective calculations used in rendering 3D points onto a 2D screen take the form of dividing the camera-relative coordinates by distance from camera and multiplying by a field-of-view parameter, as described here: http://en.wikipedia.org/wiki/Perspective_transform#Perspective_projection

So if I have a set of long horizontal parallel lines, like looking across a huge chess board, shouldn't the lines take on a slight curve on the 2D rendered output, since the lines are closer to the camera in the middle than at the ends?

I don't see this happening in real 3D rendering so I wondered if I have a mistake in my math, or if it's simply the case that the effect is so small it's not noticed?

  • 0
    Your image of a chess board, where the lines are wider apart in the middle: that is not perspective projection. Perhaps it is a "fish-eye" image. http://en.wikipedia.org/wiki/Fisheye_lens2012-04-05

1 Answers 1

2

Your interpretation of the math is slightly off. In perspective projection, you divide the camera-relative $x$- and $y$-coordinates by the camera-relative $z$-coordinate, not by the full distance $\sqrt{x^2+y^2+z^2}$. This has the nice property that all straight lines in 3D project to straight lines in the image plane. If you are looking directly at a chessboard, for example, everything has the same $z$-coordinate, and so all the lines still appear as straight and parallel.

There are other ways to project a 3D scene onto the 2D image plane, and in some of them, straight lines do curve. But the standard perspective projection is the one most commonly used in 3D graphics, and one reason for that is precisely that it preserves straight lines. So if you want to render a polygon floating somewhere in 3-space, you don't have to draw some weird curvy thing, you just project its vertices and connect them with straight line segments.