• Create Account

### #ActualTrienco

Posted 03 September 2012 - 10:52 PM

If you want to zoom, zoom. Don't scale, don't move closer to the object or any of the other misguided attempts to make stuff "look bigger" that will eventually result in clipping if you move to close or scale too much.

Imagine you zoom in on a house, but a branch from a tree in front of you is covering half of it. Does it make any sense for a zoom to magically have the branch disappear, because it got clipped or you moved past it?

As dpadam450 already said, zoom by adjusting the projection matrix like a "real camera" and you won't get any unexpected effects.

Why would you care about the aspect ratio? It doesn't change if you multiply ALL sides by the same factor (as in: the two dimensions that matter).

Get in the habit of setting your ortho projection at the beginning of each frame, multiply your dimensions with your current zoom factor and be done with it. It works best if your projection is symmetric (from -x to +x instead of from 0 to +x) or you will need to also shift the values to avoid drifting closer to one corner.

Zoom in: zoom factor / 1.2, zoom out: zoom factor * 1.2. (or whatever numbers works for you)

### #1Trienco

Posted 03 September 2012 - 10:47 PM

If you want to zoom, zoom. Don't scale, don't move closer to the object or any of the other misguided attempts to make stuff "look bigger" that will eventually result in clipping if you move to close or scale too much.

Imagine you zoom in on a house, but a branch from a tree in front of you is covering half of it. Does it make any sense for a zoom to magically have the branch disappear, because it got clipped or you moved past it?

As dpadam450 already said, zoom by adjusting the projection matrix like a "real camera" and you won't get any unexpected effects.

Why would you care about the aspect ratio? It doesn't change if you multiply ALL sides by the same factor.

Get in the habit of setting your ortho projection at the beginning of each frame, multiply your dimensions with your current zoom factor and be done with it. It works best if your projection is symmetric (from -x to +x instead of from 0 to +x) or you will need to also shift the values to avoid drifting closer to one corner.

Zoom in: zoom factor / 1.2, zoom out: zoom factor * 1.2. (or whatever numbers works for you)

PARTNERS