Zooming in and out

i try to zoom my object by pressing the pg up and down key… so whenever i need to zoom i will alter the z coord by doing a translation. however, when i zoomed in too much part of the object got cut off and if zoomed further, it disappeared! is it because i have to change my viewport too?

Hi !

That is not a very good way to do it, it isn’t even “zoom”, don’t move the “camera”, change the field of view parameter when you call glPerspective, if you set the fov higher you will zoom out and if you set fov lower you will zoom in.