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: Zooming in Ortho

  1. #1
    Guest

    Zooming in Ortho

    I have a code in which you can switch between perspective and orthographics projections. in perspective one can simply zoom on the model by translating along the screen Z axis; this clearly will not work in ortho and in ortho i use scaling. since i am using two different methods to perform zooming, when i then switch between the ortho and perspective projections the model is usually not visible.

    how can i do the zooming consistently in the two projection modes ? should i use glFrustum and glOrtho directly; any example code would be very helpful.

    Thanks

  2. #2

    Re: Zooming in Ortho

    moving the camera is actually "dollying". to zoom in perspective, change the field of view (fov), which is the angle of the frustum.

    then you could equate the ortho view to a box aligned with the direction of the perspective camera. when the fov is widened or narrowed, the ortho view should expand or contract.

  3. #3
    Intern Contributor
    Join Date
    Aug 2000
    Location
    france
    Posts
    89

    Re: Zooming in Ortho

    Hi, i actually use a graphic in 2D so i use glOrtho function.

    void glOrtho( GLdouble left,
    GLdouble right,
    GLdouble bottom,
    GLdouble top,
    GLdouble zNear,
    GLdouble zFar )

    To zoom i just change the left, rigth, bottom and top parameters. Diong this, i do not scale or change the geometry of the graphic.

    Hope that helps

  4. #4
    Junior Member Newbie
    Join Date
    Nov 2000
    Location
    Erlangen, Germany
    Posts
    28

    Re: Zooming in Ortho

    Hi
    The following function helps to zoom it. When I enlarge,a part of the object is invisible. Is there any method to put scroll bars to reach any part of screen.

    void glOrtho( GLdouble left,
    GLdouble right,
    GLdouble bottom,
    GLdouble top,
    GLdouble zNear,
    GLdouble zFar )

Posting Permissions

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