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.

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.

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.

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

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.

Hi all, here is the small trouble of a new-comer to OpenGL. Who knows how to convert a 3D point to a normal point (screen coordinate) and how to do on the contrary.
For example:
CRect rc;
GetClientRect(rc);
int x, y;
double u, v, t;

// And how to do this
// 1. M1(1.0, -0.7, 2.3) --> M2(x, y) ;
// 1. M2(100, 120) --> M1(u, v, t);
// where x in [rect.left, rect.right] and y in [rect.top, rect.bottom]
By the way, who can tell me how to load the current matrix to an array (double mymatrix[16]).
Please help me.
Thanks for your care

//...and create 'zoomport' details just like a normal viewport.
int zoomport[4];
zoomport[0] = //X of top left of zoom area
zoomport[1] = //Y of top left of zoom area
zoomport[2] = //Width of zoom area
zoomport[3] = //Height of zoom area

//Then use pickmatrix to zoom in on this part of the scene...
gluPickMatrix(zoomport[0]+zoomport[2]/2, zoomport[1]+zoomport[3]/2, zoomport[2], zoomport[3], viewport);