View Full Version : zoom in/out
10-28-2009, 12:47 AM
Can somebody help me with how can I zoom in and zoom out my objects on the screen ! I am trying with gluPerspective() bby changing angle bbut unsuccessfuk ! Any help would be highly appreciated !!
10-28-2009, 05:08 AM
Changing the field of view (FOV) can be a method to zoom-in/zoom-out. The equivalent of the human eye is about 41 deg. Let's that be x1 zoom. If you want to zoom-in, reduce FOV.
The formula for calculating FOV from zoom-factor requires size of the sensor (d) and lens's focal length (f):
FOV = 2 * arctan((d/2)/(1/f))
A solid-state 1/4" sensor (the most common case in cameras today) is 3.6mm wide and 2.7mm high.
Zooming, in fact, is performed by varying focal length.
I'm using the following formula to calculate FOV from zoom factor:
FOV = 2.0 * atan(d/(2*minFocalLength*zoom)) * toDeg;
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.