View Full Version : Frustrum Points Coordinates

Antorian

09-01-2002, 01:23 PM

I would like to get (with a fast method) the points that limits the frustum (4 for the front near plan & 4 for the front far plan)

I just would like coordinates of these point with a few instructions.

I uses for the moment, the intersection plane from the planes got by multiplying projection & modelview matrix.

But I'm not enough good in maths to get a fast solution

Yes I need to learn

But If anyone got a simple solution....

Thanks

ioquan

09-02-2002, 01:45 AM

Well, you should calculate them ahead of time (whenever a new perspective matrix is calculated)and store them. So long as you're not changing your perspective matrix on every frame, the speed is irrelevant

I have a way that I came up with for getting the points, but its kind of a hack and I'm too lazy to open my code right now. Here is the basic idea though:

Take the vector (0,0,-1) (assuming -z is in front of the viewer), rotate it around the x axis by half of the vertical FOV, rotate it around the y axis by half of the horizontal FOV, then extend that vector to the far clipping plane. That will give you the top right corner. The others are easy to find once you have the first one.

Antorian

09-02-2002, 02:23 AM

I cannot use that, 'cause I've got a camera and my point of view changes at each frame.

So my frustrum orientation also changes (and rotate along X and Y axis by half of fov means you are wathing along z axis (but if I'm upside down with my camera it must be different, same case with watching along Y axis or X)

I've already thinks about that but it leads to get lot of test to know how my camera is placed (to many special cases).

I don't serach an iterative method, but a direct method (I uses the frustrum culling exmple from GameTutorials site: It gives a method to get planes from the frustrum, but I would like to get Points that limit my frustrum)

Thanks

Antorian

09-02-2002, 04:50 AM

Ok http://www.opengl.org/discussion_boards/ubb/biggrin.gif I've found a simply method using glUnProject (with limits of my viewport)

It works perfectly

Thanks

PS:sorry for disturbing

Leyder Dylan

09-02-2002, 11:30 AM

I use his metho in my 3D engine and it works well !

www.markmorley.com (http://www.markmorley.com)

Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.