Click here to Skip to main content
Licence 
First Posted 11 Feb 2002
Views 163,420
Bookmarked 49 times

True OpenGL Zooming

By | 11 Feb 2002 | Article
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

About the Author

pepito sbarzeguti



Italy Italy

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralAbout 3D point PinmemberEduardo Tucci15:54 29 Jun '10  
QuestionPanning in perspective view? PinmemberHan Wu5:27 17 Nov '06  
Generali want to use 3dmax , opengl and c# Pinmembereey5621:53 30 Oct '06  
Generalopengl control ... Pinmemberdoudicool11:34 5 May '06  
GeneralAdd Scroll Bar Pinmemberanil22:14 6 Sep '05  
Generalzooming Pinmembersreejith ss nair20:24 28 Apr '05  
QuestionHow To Load 3DMax Objects in OpenGL? Pinmemberobaid salikeen23:31 25 Apr '05  
Generalis it possible to use it for dialogs Pinmembernandeeshds5:05 28 Oct '04  
QuestionHow to run 2 different(or same) OpenGL objects in one DialogBox? Pinmemberwerter121:10 3 May '04  
QuestionHOW TO DRAW A CIRCULAR SCALE? Pinmemberprath2:46 8 Apr '03  
Questionhow to ZOOM? Pinmemberprath2:43 8 Apr '03  
General3D coordinate Pinmembereddymohd22:24 19 Feb '03  
GeneralRe: 3D coordinate Pinmembertopus2:21 19 May '03  
GeneralRe: 3D coordinate PinsussAnonymous4:58 9 Jun '05  
GeneralSmall question about OpenGL PinmemberAnonymous0:05 28 May '02  
GeneralRe: Small question about OpenGL PinmemberAli Khanlarkhani0:33 19 Jan '03  
GeneralHey Man PinmemberRick York13:09 16 Feb '02  
GeneralAn Easier Way.... PinmemberFatBuddha7:34 13 Feb '02  
GeneralRe: An Easier Way.... Pinmemberpepito sbarzeguti21:30 13 Feb '02  
GeneralRe: An Easier Way.... PinmemberFatBuddha7:00 14 Feb '02  
GeneralRe: An Easier Way.... PinmemberAlberto Bencivenni3:06 12 Dec '05  
GeneralRe: An Easier Way.... Pinmembera_david12323:36 21 Jun '07  
GeneralBroken link's Pinmemberpepito sbarzeguti6:36 12 Feb '02  
QuestionHOW to scroll with a scrollbar in opengl Pinmembersyphax511:20 19 Apr '04  

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.

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