Click here to Skip to main content
15,072,890 members
Articles / Desktop Programming / MFC
Posted 11 Feb 2002


66 bookmarked

True OpenGL Zooming

Rate me:
Please Sign up or sign in to vote.
4.60/5 (17 votes)
11 Feb 2002
True zooming on a perspective view...

Sample Image - Zoom.jpg


The topic of this article is focused around zooming in a perspective OpenGL view. I wrote this article because I found some examples of zooming in a OpenGL view using ortho projections. But the most advanced example that I found using perspective projections, don't implement a true zooming but simulate the zooming effect changing the view point or camera angle. The technique that I suggest implement a true zooming and not change camera angle or perspective parameters (view point, reference point clipping planes). I achieved this result using the function glFrustum instead of standard gluPerspective and manipulating (see function COGL::SetPerspective(const CRect &rcClient) in the class COGL) the scaling and translating parameters of projection matrix. Two normalized rectangles are maintained by the COGL class: one for the full size image, and one for the current zooming rectangle. The image presented by OpenGL is scaled by the ratio of the rectangles, adjusted according to the viewport aspect and translated to the center of current zooming rectangle.

Finally sorry for my poor English.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

No Biography provided

Comments and Discussions

QuestionZoom window for orthographic projection Pin
Anup Walvekar26-Oct-15 16:22
MemberAnup Walvekar26-Oct-15 16:22 
GeneralAbout 3D point Pin
Eduardo Tucci29-Jun-10 15:54
MemberEduardo Tucci29-Jun-10 15:54 
QuestionPanning in perspective view? Pin
TaiZhong17-Nov-06 5:27
MemberTaiZhong17-Nov-06 5:27 
Generali want to use 3dmax , opengl and c# Pin
eey5630-Oct-06 21:53
Membereey5630-Oct-06 21:53 
Generalopengl control ... Pin
doudicool5-May-06 11:34
Memberdoudicool5-May-06 11:34 
GeneralAdd Scroll Bar Pin
_anil_6-Sep-05 22:14
Member_anil_6-Sep-05 22:14 
Generalzooming Pin
sreejith ss nair28-Apr-05 20:24
Membersreejith ss nair28-Apr-05 20:24 
QuestionHow To Load 3DMax Objects in OpenGL? Pin
obaid salikeen25-Apr-05 23:31
Memberobaid salikeen25-Apr-05 23:31 
Generalis it possible to use it for dialogs Pin
nandeeshds28-Oct-04 5:05
Membernandeeshds28-Oct-04 5:05 
QuestionHow to run 2 different(or same) OpenGL objects in one DialogBox? Pin
werter13-May-04 21:10
Memberwerter13-May-04 21:10 
prath8-Apr-03 2:46
Memberprath8-Apr-03 2:46 
Questionhow to ZOOM? Pin
prath8-Apr-03 2:43
Memberprath8-Apr-03 2:43 
General3D coordinate Pin
eddymohd19-Feb-03 22:24
Membereddymohd19-Feb-03 22:24 
GeneralRe: 3D coordinate Pin
topus19-May-03 2:21
Membertopus19-May-03 2:21 
GeneralRe: 3D coordinate Pin
Anonymous9-Jun-05 4:58
MemberAnonymous9-Jun-05 4:58 
GeneralSmall question about OpenGL Pin
28-May-02 0:05
suss28-May-02 0:05 
GeneralRe: Small question about OpenGL Pin
Ali Khanlarkhani19-Jan-03 0:33
MemberAli Khanlarkhani19-Jan-03 0:33 
GeneralHey Man Pin
Rick York16-Feb-02 13:09
mveRick York16-Feb-02 13:09 
GeneralAn Easier Way.... Pin
FatBuddha13-Feb-02 7:34
MemberFatBuddha13-Feb-02 7:34 
GeneralRe: An Easier Way.... Pin
pepito sbarzeguti13-Feb-02 21:30
Memberpepito sbarzeguti13-Feb-02 21:30 
GeneralRe: An Easier Way.... Pin
FatBuddha14-Feb-02 7:00
MemberFatBuddha14-Feb-02 7:00 
GeneralRe: An Easier Way.... Pin
Alberto Bencivenni12-Dec-05 3:06
MemberAlberto Bencivenni12-Dec-05 3:06 
GeneralRe: An Easier Way.... Pin
a_david12321-Jun-07 23:36
Membera_david12321-Jun-07 23:36 
GeneralBroken link's Pin
pepito sbarzeguti12-Feb-02 6:36
Memberpepito sbarzeguti12-Feb-02 6:36 
Sorry broken link's fixed. Pepito

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.