Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: How to add a zoom function

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2004
    Posts
    5

    How to add a zoom function

    Hello everyone,
    I am looking for an easy way to zoom on a part of a scene. For the moment I use gluPickMatrix() to give the part of the window I want my zoom on and then I call gluPerspective(). The problem is I don't get my zoom on the rectangle I was hoping, it goes somewhere else...
    So I would like to know if it is a (good) way to do it or not and if not, can everyone give me another method....I can't find examples on the web.
    Thank you for your help

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,651

    Re: How to add a zoom function

    You can just change the field of view parameter in your perspective projection.

    Mikael

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2004
    Posts
    5

    Re: How to add a zoom function

    Yes I have seen this easy way, thank you for your reply. But at the moment I can select a box to zoom on so I would like to zoom exactly on this box, with gluPerspective I will zoom on the center point (right?), not exactly on my box....I can try to put the center of my box in the middle of the viewport and then zoom...No?
    If anyone knows how I could achieve that simply....thank you to let me know

  4. #4
    Junior Member Regular Contributor
    Join Date
    Sep 2003
    Location
    Ireland
    Posts
    136

    Re: How to add a zoom function

    Use a combination of gluLookAt, and fov.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •