How to understand orthographic camera movement?

I’m trying to make sense of the orthographic camera mode.

I understand that I can set the area which the camera shows by setting:

  • orthoLeft
  • orthoRight
  • orthoTop
  • orthoBottom

But when I try to monitor the movement of the camera, these properties don’t seem to change. For example by doing:

camera.onViewMatrixChangedObservable.add(() => {
    console.log(camera.orthoLeft, camera.orthoRight, camera.orthoTop, camera.orthoBottom);
});

However, by setting these properties I’m able to move the camera. For example:

setTimeout(() => {
    camera.orthoLeft +=1;
    camera.orthoRight +=1;
}, 1000);

My understanding was that these properties define the area that the camera is viewing, but now I’m not sure if that’s correct.

  • What’s the correct way to change the position of a camera in orthographic projection? Should I use these ortho* properties or not?
  • What’s the real meaning of these ortho* properties? Like, what does the orthoLeft really mean? Like, is it the left relative to world 0,0,0 coordinate, or something else?

The documentation of orthoLeft says:

Define the current limit on the left side for an orthographic camera In scene unit

I’m not sure how to interpret that.

Hmmm… I think I get it now.

Is it that the orthoLeft etc properties are relative to the camera target coordinate?

Hello :slight_smile:

Yes.

You can see the ortho camera as an infinite plane, with a center C :

Projecting the scene all parallel, along its normal. C will be the center of the image

In this context the image is “theorically” infinitely wide. So you have a 4 param to crop it :


Then, when the camera moves, it changes only the point C (center of image), as well as the angle of the plane (and therefore, its normal projection vector).

So there is no reason for orthoLeft, etc … To change when you move the camera.

Thanks for a thorough explanation.

I was initially confused because the camera seemed to move when I moved the ortho* attributes.