Results 1 to 4 of 4

Thread: gluPerspective Near and Far Plane

  1. #1
    Member Contributor
    Join Date
    May 2002
    Location
    AUSTRIA
    Posts
    83

    gluPerspective Near and Far Plane

    Hi!
    I create my viewing volume with:
    gluPerspective(angle, (GLfloat)w / (GLfloat)h, radius/100, 3*radius);
    Then i wanted to create a quad at the near and at the far plane, which fill the whole plane. I thought that the width
    and the height on the near plane are:
    heigth=tan(angle)*radius/100*2
    width=height*w/h
    and for the far plane:
    heigth=tan(angle)*radius*3*2
    width=height*w/h

    But these values does mot match ??
    Thanks
    Juergen

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: gluPerspective Near and Far Plane

    Why not switch to an orthographic projection while drawing the quad? It's alot easier to get it to cover the entire screen that way.

  3. #3
    Member Contributor
    Join Date
    May 2002
    Location
    AUSTRIA
    Posts
    83

    Re: gluPerspective Near and Far Plane

    Why is it easier?

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: gluPerspective Near and Far Plane

    It's easier because for instance, you don't have to do any calculations to figure out the near clip plane. For instance if you used...

    glOrtho(-1, 1, -1, 1, -1, 1);

    You just draw your quad where one corner is at -1, -1, 0 and the other is at 1, 1, 0.

    Anyway, your formulas seem off. If you have the following call...

    gluPerspective(fov, aspect, near, far);

    The formulas would be something like so..

    maxY = tan(fov/2) * near;
    minY = -maxY;
    maxX = maxY * aspect;
    minX = -maxX;

    The far plane has the same formulas only you substitute far for near.



    [This message has been edited by Deiussum (edited 07-07-2002).]
    Deiussum
    Software Engineer and OpenGL enthusiast

Similar Threads

  1. Near Plane to Far Plane Line Question
    By superahoy in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 03-31-2006, 09:14 AM
  2. clip plane problems - plane extraction
    By supagu in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 10-12-2004, 03:49 AM
  3. Draw Plane with Plane Equation
    By dalangalma in forum OpenGL: General
    Replies: 2
    Last Post: 06-15-2004, 08:55 PM
  4. gluPerspective...?
    By AsylumX in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-21-2002, 05:32 PM
  5. gluperspective
    By fox in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-31-2000, 10:43 AM

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