PDA

View Full Version : Zooming using Orthographic projection



macsam
12-14-2015, 10:17 AM
Hi,
I have created an orthographic projection:

glOrtho( Left, Right, Bottom, Top, Near, Far)

I zoom into it by adjusting Left, Right, Bottom and Top. I leave Near and Far alone.
Is this the only way to zoom into a Ortho view?

It does not work well for me, especially when Bottom and top get close to equalling each other.

Any help gratefully appreciated.

MacSam

GClements
12-14-2015, 03:05 PM
You could just append a glScale() after the glOrtho().

glOrtho() essentially subtracts the maximum and minimum values in each dimension to determine the scale. If you're constructing the values as centre-size and centre+size, then you'll lose accuracy when size is small compared to centre. In that case, it would be better to just construct the projection matrix using glTranslate() and glScale() (or even just glLoadMatrix()).

macsam
12-16-2015, 10:45 AM
You could just append a glScale() after the glOrtho().

glOrtho() essentially subtracts the maximum and minimum values in each dimension to determine the scale. If you're constructing the values as centre-size and centre+size, then you'll lose accuracy when size is small compared to centre. In that case, it would be better to just construct the projection matrix using glTranslate() and glScale() (or even just glLoadMatrix()).

Thank you.

MacSam

JacobVR
01-06-2016, 03:52 AM
Orbit Controls to perform zooming in orthographic projection, but i dont get the behave that i want.
I think that is possible change the view Size that multiply to left, right, top and bottom to create a something near of a zoom.