Click here to Skip to main content
11,412,833 members (73,470 online)
Click here to Skip to main content

True OpenGL Zooming

, 11 Feb 2002
Rate this:
Please Sign up or sign in to vote.
True zooming on a perspective view...

Sample Image - Zoom.jpg

Introduction

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.

License

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

Share

About the Author

No Biography provided

Comments and Discussions

 
GeneralAbout 3D point Pin
Eduardo Tucci at 29-Jun-10 16:54
memberEduardo Tucci29-Jun-10 16:54 
QuestionPanning in perspective view? Pin
Han Wu at 17-Nov-06 6:27
memberHan Wu17-Nov-06 6:27 
Generali want to use 3dmax , opengl and c# Pin
eey56 at 30-Oct-06 22:53
membereey5630-Oct-06 22:53 
Generalopengl control ... Pin
doudicool at 5-May-06 12:34
memberdoudicool5-May-06 12:34 
GeneralAdd Scroll Bar Pin
anil at 6-Sep-05 23:14
memberanil6-Sep-05 23:14 
Generalzooming Pin
sreejith ss nair at 28-Apr-05 21:24
membersreejith ss nair28-Apr-05 21:24 
QuestionHow To Load 3DMax Objects in OpenGL? Pin
obaid salikeen at 26-Apr-05 0:31
memberobaid salikeen26-Apr-05 0:31 
Generalis it possible to use it for dialogs Pin
nandeeshds at 28-Oct-04 6:05
membernandeeshds28-Oct-04 6:05 
QuestionHow to run 2 different(or same) OpenGL objects in one DialogBox? Pin
werter1 at 3-May-04 22:10
memberwerter13-May-04 22:10 
QuestionHOW TO DRAW A CIRCULAR SCALE? Pin
prath at 8-Apr-03 3:46
memberprath8-Apr-03 3:46 
Questionhow to ZOOM? Pin
prath at 8-Apr-03 3:43
memberprath8-Apr-03 3:43 
General3D coordinate Pin
eddymohd at 19-Feb-03 23:24
membereddymohd19-Feb-03 23:24 
GeneralRe: 3D coordinate Pin
topus at 19-May-03 3:21
membertopus19-May-03 3:21 
GeneralRe: 3D coordinate Pin
Anonymous at 9-Jun-05 5:58
sussAnonymous9-Jun-05 5:58 
GeneralSmall question about OpenGL Pin
Anonymous at 28-May-02 1:05
memberAnonymous28-May-02 1:05 
GeneralRe: Small question about OpenGL Pin
Ali Khanlarkhani at 19-Jan-03 1:33
memberAli Khanlarkhani19-Jan-03 1:33 
GeneralHey Man Pin
Rick York at 16-Feb-02 14:09
memberRick York16-Feb-02 14:09 
GeneralAn Easier Way.... Pin
FatBuddha at 13-Feb-02 8:34
memberFatBuddha13-Feb-02 8:34 
GeneralRe: An Easier Way.... Pin
pepito sbarzeguti at 13-Feb-02 22:30
memberpepito sbarzeguti13-Feb-02 22:30 
GeneralRe: An Easier Way.... Pin
FatBuddha at 14-Feb-02 8:00
memberFatBuddha14-Feb-02 8:00 
GeneralRe: An Easier Way.... Pin
Alberto Bencivenni at 12-Dec-05 4:06
memberAlberto Bencivenni12-Dec-05 4:06 
GeneralRe: An Easier Way.... Pin
a_david123 at 22-Jun-07 0:36
membera_david12322-Jun-07 0:36 
GeneralBroken link's Pin
pepito sbarzeguti at 12-Feb-02 7:36
memberpepito sbarzeguti12-Feb-02 7:36 
Sorry broken link's fixed. Pepito

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150427.1 | Last Updated 12 Feb 2002
Article Copyright 2002 by pepito sbarzeguti
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid