Zoom Fit

Hi All !!!

I’m developping an interface app with some openGL graphics in it : in fact, I am drawing points (the coordinates of which come from another dialogbox) on the window…
Unfortunately the coordinate system in which those points are set is not known to me… So I’ve placed a gluLookAt() call with arguments not really accurate.(so that sometimes my points are not on the screen!!)
What I would like to know is if it is possible to find some automated transformations in order to zoom fit my points to the window (so as to see them all)…

Thanks for all hints or answers!!

Tried scaling?
Or you can just work out a routine to move the cam further away, untill everything is on screen… Dunno if thats what you mean…

[This message has been edited by RedZen (edited 08-01-2001).]

You could try finding the min and max values of the points that you are trying to view to create a “bounding box” in 3D. Then use the glOrtho command to set up the projection matrix and use gluLookAt to set your viewing transformation to “look at” the center of the bounding box.

[This message has been edited by Pat (edited 08-01-2001).]