PDA

View Full Version : Getting View Frustumīs Planes in OpenGl????



XBCT
04-18-2000, 01:12 PM
For things like View Frustum clipping I need the Plane Equations(or their normals) of the View Pyramid.I could calculate them from the Rotation matrix and the angle of view but to do this I need alot of sines + cosines which slows down things alot if one calculates them (the Planes) every frame.
I think Opengl knows these planes(īcause it does (slow) clipping ,too.
So please tell me if it is possible to get these Planes from Opengl and if so ,how does it work????

lgrosshennig
04-18-2000, 01:56 PM
Hi there!

If you want a (kind of) fast method to get a fast sine & cosine value of an given radian, you should look into the thread:
"Getting normal vectors"

Hope that helped you!

Regards,

LG http://www.opengl.org/discussion_boards/ubb/biggrin.gif

And msy the vector by with you!

XBCT
04-19-2000, 03:39 AM
Thanx,that might help if would calculate my planes myself.
But,I DONT want to calculate it myself,I want to get these Planes from OpenGl!!
So if somebody has some ideas PLEASE POST them even if they are wrong.īcause I want to continue programming.


[This message has been edited by XBCT (edited 04-19-2000).]

ribblem
04-19-2000, 06:46 AM
Depending on how your frustrum is set up you may only have to calculate 1 of the normals using your sine/cosine method. The other sides of you frustrum (assuming you don't change the frustrum should be predicably different and you would only have to figure out how they're diffrent from the "master side" of the frustrum once with some precomputed geometry.

One way to avoid any of this sine/cosine stuff would be to make a single triangle just outside your frustrum with a normal defined. If you keep it in the same location in relation to your frustrum it should always provide a normal to you frustrum. Although this method also has the over head of a triangle.

I don't know how or if it's possible to get these planes directly from OpenGL, but these would be a few ways to speed up a work around solution.

XBCT
04-19-2000, 07:02 AM
Thanx!
It looks like I have to calculate things myself(thanx for all the speed improvement tips).
BUT:IF someone knows how to get the View Frustumīs Planes from Opengl,PLEASE PLEASE tell me!!!!