Results 1 to 4 of 4

Thread: How does one change field of view in OpenGL

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2005
    Location
    DeWitt, NY
    Posts
    2

    How does one change field of view in OpenGL

    I am rendering a large scene. By default the rendered view is a very small portion of the overall scene.

    It is very straightforward to change camera position and perspective. But I have not found a way to "zoom the camera out" so that it sees a much larger portion of the scene.

    What are the ways (opengl function calls) in which I might "zoom out"?

  2. #2
    Junior Member Newbie
    Join Date
    Aug 2005
    Location
    DeWitt, NY
    Posts
    2

    Re: How does one change field of view in OpenGL

    By the way I use gluLookAt to set the camera view.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Aug 2005
    Posts
    145

    Re: How does one change field of view in OpenGL

    Other than playing with the fov in gluPerspective or fiddling with glFrustum, try creating a "dolly" for your camera, so you can roll it back along the view vector. This is amounts to a simple translation along the view vector (view = normalize(center - eye)).

    For ortho views, look at glScalef or playing with the parameters to glOrtho. To keep things symmetrical, scale from the center of projection.

  4. #4
    Super Moderator OpenGL Guru imported_dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,966

    Re: How does one change field of view in OpenGL

    One important thing to know is that the glFrustum or gluPerspective calls are made on the projection matrix, not the modelview matrix where you use your gluLookat call, so bear that in mind.

    glMatrixMode switches which matrix you are manipulating.

Similar Threads

  1. perspective from field of view
    By vankirkc in forum OpenGL: General
    Replies: 0
    Last Post: 07-09-2011, 06:38 PM
  2. Field of view from glFrustum?
    By Rad in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-22-2003, 02:10 PM
  3. gluPerspective and field of view
    By shosking in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 04-28-2002, 08:03 PM
  4. gluPerspective and field of view
    By shosking in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 04-28-2002, 08:01 PM
  5. glFrustum and field of view
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 06-22-2000, 07:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean