jSTIN
2005.04.06, 12:54 AM
How can I get an ortho view with the correct aspect ratio of my window? I need to be able to display an object in perspective and orthographic views. I tried variations of this:
double aspect = width / height; // from window dimensions
...
glOrtho(-2.5 / aspect, 2.5 / aspect, -2.5, 2.5, 0, 100);
I tried varying what got divided or multiplied by the aspect ratio, but nothing works correctly. I'm thinking glOrtho isn't the way to go.
double aspect = width / height; // from window dimensions
...
glOrtho(-2.5 / aspect, 2.5 / aspect, -2.5, 2.5, 0, 100);
I tried varying what got divided or multiplied by the aspect ratio, but nothing works correctly. I'm thinking glOrtho isn't the way to go.