View Full Version : Auto zoom functionality

Panagiotis Greece
07-16-2008, 04:29 AM

I am new to OpenGL and i face the following problem:

I display some CAD data (panels, curves etc) using OpenGL and i need to be able to automatically zoom into a current panel or curve. So, i have to re-calculate the clipping values in order
for the required panel/curve to be on the center of the view and zoomed in.

I have tried to find the min/max values of the eye coordinates of the panel/curve and then adjust accordingly the ortho clipping values, but no success.

Any help is appreciated!

Ilian Dinev
07-16-2008, 10:38 AM
You just need to use glTranslatef and glScalef. No extra toying with clipping necessary