PDA

View Full Version : glFrustum zooming in



hockeyman
07-25-2012, 01:00 AM
I want to make zoom in/out ability in my app. I'm using glFrustum projection. With zoom out i haven't met any problems. Just adjusted

glTranslatef(0.0,0.0,zoomoutFloat);. But how to adjust zoom-in? As I'm understanding, glFrustum allows to only move object on z axis to negative values. No positive values are accepted. So how to move object to positive values of z axis (zoom in)? And another question. Zoom out works OK, but how to adjust openGL frame size in dependence of zoom out value so that the textured quad (image) in my app would fully fill OpenGL view (no black background would be visible)? Image:

Now when zoomed out it looks like this:
819

And I want it to look like this:
820