Click here to Skip to main content
Click here to Skip to main content

True OpenGL Zooming

By , 11 Feb 2002
 

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
No Biography provided

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.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralAbout 3D pointmemberEduardo Tucci29 Jun '10 - 15:54 
I would like to know if when I click on screen I can transform 2D mouse point to 3D point. if yes, How can I to do this?
QuestionPanning in perspective view?memberHan Wu17 Nov '06 - 5:27 
The code for implementing the zoom window in perspective view is just perfect. It show's that, you have a deep understanding of how to create a perspective matrix. I would like to know whether you have written any article about Panning in Perspective view or not? I would be appreciated if you could show me how to do true panning in perspective view.
 
Thanks.
Generali want to use 3dmax , opengl and c#membereey5630 Oct '06 - 21:53 
I want to use 3dmax objects on the .net platform(use c# code) and also i use opengl code.Do you have any opinion about this.Please give me a example project.
 
Thank you...
 
eey56@yahoo.com
Generalopengl control ...memberdoudicool5 May '06 - 11:34 
hi ,can you tell me how can i introduce buttons ,edit zone ,all this beside an opengl child window in viual c++6.0 or in builderC++ 6.0 i am verry confused ...thank you .....
 
-- modified at 17:37 Friday 5th May, 2006
GeneralAdd Scroll Barmemberanil6 Sep '05 - 22:14 
Hello Friend
Can any body tell me how to add scroll bar to this Zoom.
 
Regards
Anil
Generalzoomingmembersreejith ss nair28 Apr '05 - 20:24 

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?memberobaid salikeen25 Apr '05 - 23:31 
hi,
i want to import a 3DMax object in my opengl project, i have used 3DSloader, but my project is now dead slow. i want to load all the objects efficiently. i tried to read all the vertices in an array to draw them, but it does not work. a hint or a code sample will help.
email:
obaid_salikeen@hotmail.com
Generalis it possible to use it for dialogsmembernandeeshds28 Oct '04 - 5:05 
hi frnd
 
is it possible to use ur beutiful zooming to zoom a bitmap on a dialog.
 
help me out
QuestionHow to run 2 different(or same) OpenGL objects in one DialogBox?memberwerter13 May '04 - 21:10 

How to run 2 different(or same) OpenGL objects in one DialogBox?
IDC_STATIC1 is a first OpenGL objects Scene window.
IDC_STATIC2 is a second OpenGL objects Scene window.
IDC_STATIC1 and IDC_STATIC2 ,they are placed on IDD_DIALOG1.
 
code:
pclStatic = (CStatic *)GetDlgItem(IDC_OpenGL_Window);
pclGlView = new CGlView(pclStatic);
pclGlView->OnCreate();
pclGlView->InitGL();
pclGlView->DrawGLScene();
 
pclStatic1 = (CStatic *)GetDlgItem(IDC_OpenGL_Window);
pclGlView1 = new CGlView(pclStatic1);
pclGlView1->OnCreate();
pclGlView1->InitGL();
pclGlView1->DrawGLScene();
 
Will not involve both windows (IDC_STATIC2,IDC_STATIC1)
QuestionHOW TO DRAW A CIRCULAR SCALE?memberprath8 Apr '03 - 2:46 
Cry | :(( HOW TO DRAW A CIRCULAR SCALE (similar to a time clock showing graduations outwards in degrees 0,5,...360.
any code...?

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

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