7
$\begingroup$

I have read through this article about perspective and orthographic projection matrices.

I started playing with the perspective matrix and as expected if I either increase/decrease the field of view i have a zoom out/in effect. Similarly, if I move the camera position forward/backwards I see the object being close or further away.

However, when I tried the orthographic matrix, since there is no field of view parameter, I tried only moving the camera forward/backwards but my model always looked the same size.

Can anybody explain to me why this is happening?

$\endgroup$

1 Answer 1

7
$\begingroup$

Perspective projection changes the size of an object as it's distance changes, while orthographic projection does not. That is part of the definition of those projection types.

To simplify things a bit, a simple perspective projection of a 3d point to a 2d point can be calculated like this:

$x_{2d} = x/z\\ y_{2d} = y/z$

As you can see, the 2d version of the x and y change depending on the value of z.

Orthographic projection on the other hand can be calculated like this:

$x_{2d} = x\\ y_{2d} = y$

In that example, you can see that the x and y values do not depend at all on z, so you can move closer to or farther away from an object in orthographic projection and it's size will not change.

As a fun bit of related trivia, the sun is so far away that when the light gets here, it's all basically going in the same direction.

This is a reason why we have directional lighting, where light beams are always moving in the same way, because that is how sun light works.

Anyways, since the light beams are parallel it means that your shadows in sun light are orthographic projections of your silhouette. In other words, as you move your hand closer to or farther from the sun here on earth, the shadow of your hand doesn't change size.

However, if you have a more local light source - light a lamp - it casts a perspective projection type of shadow, where the closer to the light source your hand is, the larger the shadow it casts.

This is tied to the definition of an orthographic projection, which is that the focal length is infinitely long. The sun is far enough away that we can consider it infinity in lighting, for as much accuracy as we care about :P

$\endgroup$
1
  • 3
    $\begingroup$ Beautifully explained, I kinda related the fact to the perspective division but wasn't sure, now I am, thanks ! $\endgroup$
    – BRabbit27
    Commented Oct 13, 2016 at 4:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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