# Thread: gluPerspective Near and Far Plane

1. ## gluPerspective Near and Far Plane

Hi!
I create my viewing volume with:
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:
width=height*w/h
and for the far plane:
width=height*w/h

But these values does mot match ??
Thanks
Juergen

2. ## 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. ## Re: gluPerspective Near and Far Plane

Why is it easier?

4. ## 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).]

#### Posting Permissions

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