How can i add zooming function.....!

I want to add zooming to my camera function…i did adding glscalef(zoom,zoom,1) after gltranslate() and also in between but the output i get was dark screen or i think it was zoom view. But removing zooming function, still i got dark screen- blank. So i want someone add suggest me how should i add zooming function?

Below is my camera function:-

glTranslatef(xtrans, ytrans, -5);
glRotatef(updateY, 1, 0, 0);
glRotatef(updateX, 0, 1, 0);
glTranslatef(-1, -1, 0);

Whatever your setup is, you can make objects look larger if you narrow your field-of-view of the projection-matrix. Like a binocular.

1 Like

Thank you its working… :grin:

This is an aside on the subject.
You should estimate the position of your nose relative to the screen, and pick the angle it makes to the screen-edges as a field of view. That way you will produce an image that supports your brain in translating the sensory impression of the invironment you send to the screen so that it can use it’s long experience with eqvivalent situations. This may belong under the heading ‘artistery’, but if your brain ‘buys’ your desecption, you deliver a more emersive experience.

This said for you to estimate if you should move the camera closer or narrow the field of view to make things larger.