Click here to Skip to main content
6,294,871 members and growing! (17,256 online)
Email Password   helpLost your password?
Multimedia » OpenGL » General     Intermediate

True OpenGL Zooming

By pepito sbarzeguti

True zooming on a perspective view...
VC6Win2K, WinXP, MFC, OpenGL, Dev
Posted:11 Feb 2002
Views:127,975
Bookmarked:38 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
25 votes for this article.
Popularity: 5.91 Rating: 4.23 out of 5
1 vote, 7.1%
1

2
1 vote, 7.1%
3
3 votes, 21.4%
4
9 votes, 64.3%
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


Member

Location: Italy Italy

Other popular OpenGL articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 23 of 23 (Total in Forum: 23) (Refresh)FirstPrevNext
GeneralPanning in perspective view? PinmemberHan Wu6:27 17 Nov '06  
Generali want to use 3dmax , opengl and c# Pinmembereey5622:53 30 Oct '06  
Generalopengl control ... Pinmemberdoudicool12:34 5 May '06  
GeneralAdd Scroll Bar Pinmemberanil23:14 6 Sep '05  
Generalzooming Pinmembersreejith ss nair21:24 28 Apr '05  
GeneralHow To Load 3DMax Objects in OpenGL? Pinmemberobaid salikeen0:31 26 Apr '05  
Generalis it possible to use it for dialogs Pinmembernandeeshds6:05 28 Oct '04  
GeneralHow to run 2 different(or same) OpenGL objects in one DialogBox? Pinmemberwerter122:10 3 May '04  
GeneralHOW TO DRAW A CIRCULAR SCALE? Pinmemberprath3:46 8 Apr '03  
Generalhow to ZOOM? Pinmemberprath3:43 8 Apr '03  
General3D coordinate Pinmembereddymohd23:24 19 Feb '03  
GeneralRe: 3D coordinate Pinmembertopus3:21 19 May '03  
GeneralRe: 3D coordinate PinsussAnonymous5:58 9 Jun '05  
GeneralSmall question about OpenGL PinmemberAnonymous1:05 28 May '02  
GeneralRe: Small question about OpenGL PinmemberAli Khanlarkhani1:33 19 Jan '03  
GeneralHey Man PinmemberRick York14:09 16 Feb '02  
GeneralAn Easier Way.... PinmemberFatBuddha8:34 13 Feb '02  
GeneralRe: An Easier Way.... Pinmemberpepito sbarzeguti22:30 13 Feb '02  
GeneralRe: An Easier Way.... PinmemberFatBuddha8:00 14 Feb '02  
GeneralRe: An Easier Way.... PinmemberAlberto Bencivenni4:06 12 Dec '05  
GeneralRe: An Easier Way.... Pinmembera_david1230:36 22 Jun '07  
GeneralBroken link's Pinmemberpepito sbarzeguti7:36 12 Feb '02  
GeneralHOW to scroll with a scrollbar in opengl Pinmembersyphax512: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-2009
Web12 | Advertise on the Code Project