Skip to main content
Email Password   helpLost your password?

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.

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralPanning in perspective view? Pin
Han Wu
6:27 17 Nov '06  
Generali want to use 3dmax , opengl and c# Pin
eey56
22:53 30 Oct '06  
Generalopengl control ... Pin
doudicool
12:34 5 May '06  
GeneralAdd Scroll Bar Pin
anil
23:14 6 Sep '05  
Generalzooming Pin
sreejith ss nair
21:24 28 Apr '05  
GeneralHow To Load 3DMax Objects in OpenGL? Pin
obaid salikeen
0:31 26 Apr '05  
Generalis it possible to use it for dialogs Pin
nandeeshds
6:05 28 Oct '04  
GeneralHow to run 2 different(or same) OpenGL objects in one DialogBox? Pin
werter1
22:10 3 May '04  
GeneralHOW TO DRAW A CIRCULAR SCALE? Pin
prath
3:46 8 Apr '03  
Generalhow to ZOOM? Pin
prath
3:43 8 Apr '03  
General3D coordinate Pin
eddymohd
23:24 19 Feb '03  
GeneralRe: 3D coordinate Pin
topus
3:21 19 May '03  
GeneralRe: 3D coordinate Pin
Anonymous
5:58 9 Jun '05  
GeneralSmall question about OpenGL Pin
Anonymous
1:05 28 May '02  
GeneralRe: Small question about OpenGL Pin
Ali Khanlarkhani
1:33 19 Jan '03  
GeneralHey Man Pin
Rick York
14:09 16 Feb '02  
GeneralAn Easier Way.... Pin
FatBuddha
8:34 13 Feb '02  
GeneralRe: An Easier Way.... Pin
pepito sbarzeguti
22:30 13 Feb '02  
GeneralRe: An Easier Way.... Pin
FatBuddha
8:00 14 Feb '02  
GeneralRe: An Easier Way.... Pin
Alberto Bencivenni
4:06 12 Dec '05  
GeneralRe: An Easier Way.... Pin
a_david123
0:36 22 Jun '07  
GeneralBroken link's Pin
pepito sbarzeguti
7:36 12 Feb '02  
GeneralHOW to scroll with a scrollbar in opengl Pin
syphax51
2:20 19 Apr '04  


Last Updated 11 Feb 2002 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009