12,300,191 members (57,060 online)
alternative version

226.9K views
62 bookmarked
Posted

True OpenGL Zooming

, 11 Feb 2002
 Rate this:
True zooming on a perspective view...

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.

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

Share

 Italy
No Biography provided

You may also be interested in...

 FirstPrev Next
 3D coordinate eddymohd19-Feb-03 22:24 eddymohd 19-Feb-03 22:24
 Re: 3D coordinate topus19-May-03 2:21 topus 19-May-03 2:21
 Re: 3D coordinate Anonymous9-Jun-05 4:58 Anonymous 9-Jun-05 4:58
 Small question about OpenGL Anonymous28-May-02 0:05 Anonymous 28-May-02 0:05
 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
 Re: Small question about OpenGL Ali Khanlarkhani19-Jan-03 0:33 Ali Khanlarkhani 19-Jan-03 0:33
 Hey Man Rick York16-Feb-02 13:09 Rick York 16-Feb-02 13:09
 An Easier Way.... FatBuddha13-Feb-02 7:34 FatBuddha 13-Feb-02 7:34
 Re: An Easier Way.... pepito sbarzeguti13-Feb-02 21:30 pepito sbarzeguti 13-Feb-02 21:30
 Re: An Easier Way.... FatBuddha14-Feb-02 7:00 FatBuddha 14-Feb-02 7:00
 Re: An Easier Way.... Alberto Bencivenni12-Dec-05 3:06 Alberto Bencivenni 12-Dec-05 3:06
 Re: An Easier Way.... a_david12321-Jun-07 23:36 a_david123 21-Jun-07 23:36
 Broken link's pepito sbarzeguti12-Feb-02 6:36 pepito sbarzeguti 12-Feb-02 6:36
 Last Visit: 31-Dec-99 18:00     Last Update: 29-May-16 6:52 Refresh 1

General    News    Suggestion    Question    Bug    Answer    Joke    Praise    Rant    Admin

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.