PDA

View Full Version : Fitting scene to camera



01-05-2001, 10:12 AM
Hi,

I need to tightly fit a scene to the camera while maintaining the camera direction. How can this be achieved?

Thanx in advance

DjinnKahn
01-06-2001, 09:57 AM
I'm not sure, but maybe you could send the corners of a bounding box of your scene through glRasterPos3f (?) .... this should give the screen coordinates of the corners.

Then you find the rectangle bounding the 3D box on the screen.

Then you scale the scene or zoom (?) by the factor that the rectangle needs to be enlarged to fill the entire screen space.

I'm not sure that this works, just an idea. . .