Frustrum culling between DX and OpenGL

Started by
3 comments, last by revearz 20 years ago
Hi, I am trying to port my frustrum generation code from DirectX to OpenGL. My reference for the frustrum generation is from http://www2.ravensoft.com/users/ggribb/plane%20extraction.pdf which works great in DirectX. When I tried to port it over to OpenGL ( using the code provided in the paper ), some of my frustrum planes are different. Before normalizing the planes: - Top and Bottom planes are same - Near and Far planes in OpenGL is double the size of DX ( but they will equal after normalization ) - Left and Right are totally different. Anyone encountered a similar problem? Might just be some silly mistake that I made but I've been trying to debug it for a few days without luck. Thanks. [edited by - Revearz on March 30, 2004 1:11:54 AM]
Advertisement
GameTutorials - OpenGL Frustum Culling Tutorial
Hi,

The function CalculateFrustum() provided in the tutorial seems to calculate the same thing as provided in http://www2.ravensoft.com/users/ggribb/plane%20extraction.pdf. Any ideas on what else the problem would be?
Did you take matrix order into account?
Do you mean row-major vs. column-major? If so, I tried transposing the view*proj matrix and did not get correct frustrum planes.

If you mean ( view * proj ) vs. ( proj * view ), I tried that too.

It's only the left and right frustrum planes that are not equal. Wonder why .....


Edit:

Just wondering what values you get for the plane with the following variables:

VIEW
camera pos = ( 76.035828f, 95.931946f, 219.078842f )
camera reference = ( -100.566727f, 71.477310f, 177.845230f)
camera up = ( 0, 1, 0 )
lookat = reference - pos

PROJECTION
near = 1.0f
far = 300.0f
FOV = PI / 4
aspect = 1.7647058


[edited by - Revearz on March 30, 2004 3:57:22 AM]

This topic is closed to new replies.

Advertisement