5,401,186 members and growing! (18,533 online)
Email Password   helpLost your password?
Multimedia » OpenGL » General     Intermediate

True OpenGL Zooming

By pepito sbarzeguti

True zooming on a perspective view...
VC6, C++Windows, Win2K, WinXP, MFC, OpenGL, VS6, Visual Studio, Dev

Posted: 11 Feb 2002
Updated: 11 Feb 2002
Views: 116,986
Bookmarked: 28 times
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
22 votes for this Article.
Popularity: 5.60 Rating: 4.17 out of 5
1 vote, 9.1%
1
0 votes, 0.0%
2
1 vote, 9.1%
3
2 votes, 18.2%
4
7 votes, 63.6%
5

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



Location: Italy Italy

Other popular OpenGL articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 23 of 23 (Total in Forum: 23) (Refresh)FirstPrevNext
Subject  Author Date 
GeneralPanning in perspective view?memberHan Wu6:27 17 Nov '06  
Generali want to use 3dmax , opengl and c#membereey5622:53 30 Oct '06  
Generalopengl control ...memberdoudicool12:34 5 May '06  
GeneralAdd Scroll Barmemberanil23:14 6 Sep '05  
Generalzoomingmembersreejith ss nair21:24 28 Apr '05  
GeneralHow To Load 3DMax Objects in OpenGL?memberobaid salikeen0:31 26 Apr '05  
Generalis it possible to use it for dialogsmembernandeeshds6:05 28 Oct '04  
GeneralHow to run 2 different(or same) OpenGL objects in one DialogBox?memberwerter122:10 3 May '04  
GeneralHOW TO DRAW A CIRCULAR SCALE?memberprath3:46 8 Apr '03  
Generalhow to ZOOM?memberprath3:43 8 Apr '03  
General3D coordinatemembereddymohd23:24 19 Feb '03  
GeneralRe: 3D coordinatemembertopus3:21 19 May '03  
GeneralRe: 3D coordinatesussAnonymous5:58 9 Jun '05  
GeneralSmall question about OpenGLmemberAnonymous1:05 28 May '02  
GeneralRe: Small question about OpenGLmemberAli Khanlarkhani1:33 19 Jan '03  
GeneralHey ManmemberRick York14:09 16 Feb '02  
GeneralAn Easier Way....memberFatBuddha8:34 13 Feb '02  
GeneralRe: An Easier Way....memberpepito sbarzeguti22:30 13 Feb '02  
GeneralRe: An Easier Way....memberFatBuddha8:00 14 Feb '02  
GeneralRe: An Easier Way....memberAlberto Bencivenni4:06 12 Dec '05  
GeneralRe: An Easier Way....membera_david1230:36 22 Jun '07  
GeneralBroken link'smemberpepito sbarzeguti7:36 12 Feb '02  
GeneralHOW to scroll with a scrollbar in openglmembersyphax512:20 19 Apr '04  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 11 Feb 2002
Editor: Smitha Vijayan
Copyright 2002 by pepito sbarzeguti
Everything else Copyright © CodeProject, 1999-2008
Web16 | Advertise on the Code Project