Results 1 to 4 of 4

Thread: glFrustum and field of view

  1. #1
    Guest

    glFrustum and field of view

    glFrustum(), which I find easy and intuitive to use,
    also implicitly specifies the field-of-view/projection.
    However, the problem with that is that, suppose I'm close
    to an enclosure on one side, that enclosure polygon will
    get clipped and whatever is outside it will be rendered.

    I believe I can fix this by modifying the projection to
    "zoom in" one I've set the frustum; can anyone give me
    some pointers to how that is accomplished? Thanks in
    advance.

  2. #2
    Guest

    Re: glFrustum and field of view

    I answered my own question. Thanks, me.

    glFrustum(-1., 1., -1., 1., 1., 40.);
    glScalef(1.1, 1.2, 1.1);

    This seems to give OK proportions and avoid the clipping
    of near-side polygons revealing what's behind (I don't
    allow the viewer to come closer than 0.5 units from the
    edge). The 1.2 to 1.1 ratio is to compensate for my
    window's aspect ratio.

  3. #3
    Member Contributor
    Join Date
    May 2000
    Location
    Ottawa, Ontario, Canada
    Posts
    75

    Re: glFrustum and field of view

    Remeber to recalculate all of your normals. glScale won't do it for you.

  4. #4
    Guest

    Re: glFrustum and field of view

    Thanks for the reminder.

    Talking this over with a friend and drawing it out on a
    conveniently located whiteboard, I realized I was confused
    about what I wanted to do; just bringing the near plane
    closer and also scaling in the left/right/top/bottom
    distances
    was what I really wanted; that will preserve
    the field of view while not allowing half-clipped barriers
    on the sides.

Similar Threads

  1. Shadow Map field of view
    By mchartings in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 07-08-2014, 06:31 AM
  2. Field of view question
    By Stuart McDonald in forum OpenGL: General
    Replies: 1
    Last Post: 04-19-2007, 07:56 PM
  3. Field of view from glFrustum?
    By Rad in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-22-2003, 02:10 PM
  4. gluPerspective and field of view
    By shosking in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 04-28-2002, 08:03 PM
  5. gluPerspective and field of view
    By shosking in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 04-28-2002, 08:01 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