Click here to Skip to main content
Licence 
First Posted 11 Feb 2002
Views 159,122
Downloads 4,521
Bookmarked 48 times

True OpenGL Zooming

By pepito sbarzeguti | 11 Feb 2002
True zooming on a perspective view...
1 vote, 7.1%
1

2
1 vote, 7.1%
3
3 votes, 21.4%
4
9 votes, 64.3%
5
4.65/5 - 25 votes
1 removed
μ 4.23, σa 2.01 [?]

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 Tucci16:54 29 Jun '10  
QuestionPanning 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  

I have a winform application. One of my winform contain a panel with few child controls. I would like to impliment zooming (like 50 % , 100 % etc) facility for all child controls which are avilable inside that panel.
The main reason is, i have a collection of controls inside that perticular panel. Sometime user want to see some or all controll at a streach without scrolling panel up and down.
 

How will do this ? Please post your idea.

 
Sreejith Nair
[ My Articles ]
QuestionHow 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  
QuestionHow to run 2 different(or same) OpenGL objects in one DialogBox? Pinmemberwerter122:10 3 May '04  
QuestionHOW TO DRAW A CIRCULAR SCALE? Pinmemberprath3:46 8 Apr '03  
Questionhow 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  
QuestionHOW to scroll with a scrollbar in opengl Pinmembersyphax512: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
Web01 | 2.5.120210.1 | Last Updated 12 Feb 2002
Article Copyright 2002 by pepito sbarzeguti
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid