# OpenGL Frustum Determination

This topic is 4411 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I've been reading the article "Frustum Culling In OpenGL", and I'm wondering exactly how it works. The article states to multiply the modelview matrix and the projection matrix. Then finds the difference/sum of certain positions in the matrix. Can anyone help shed some light on, or point me in the right direction, as to why/how this works? I'm fairly solid with matrices and vectors, I'm just a little confused as to how we get the frustum planes from all of that. Thanks.

##### Share on other sites
The modelview-projection matrix takes points from world-space to screen-space, as I'm sure you know. The viewing frustum, is the preimage of the screen (a cube) under this transformation. The near and far clipping-planes are the preimages of the screen rectangle at z = 1, z = 0; the other four planes correspond to the edges of the screen.

If you look at the equations of the planes of this cube (in screen-space), you'll see that they have a lot of zeros (when compared to the general equation of a plane), primarily because they are axis-aligned. This means that when put them through the inverse modelview-projection matrix, only a few of the matrix entries come into play. If you felt compelled to do so, you could write down the primaries of these planes, invert a general mvp matrix and apply the transformation. You'd find that the resulting vectors come out exactly as the well-documented frustum formulas say they should.

There is nothing magical about this. An average intellect could not look at a compound projection matrix and say 'just add these matrix elements together to get frustum plane A, ...'. Originally, the algebra was done manually, and the results recorded and distributed so nobody else had to waste their time doing the donkey-work. Obviously in retrospect, looking at the resulting formulas, certain relations make perfect sense. Others are not so obvious.

I'd advise you to just take this as read. If you're still not happy, I guess there isn't much else you can do but to derive the formulas yourself.

Regards

##### Share on other sites
Quote:
 Original post by DaishimI've been reading the article "Frustum Culling In OpenGL", and I'm wondering exactly how it works. The article states to multiply the modelview matrix and the projection matrix. Then finds the difference/sum of certain positions in the matrix. Can anyone help shed some light on, or point me in the right direction, as to why/how this works? I'm fairly solid with matrices and vectors, I'm just a little confused as to how we get the frustum planes from all of that.Thanks.
If you're interested in the derivation, I suggest you google for a paper called "Fast Extraction of Viewing Frustum Planes from the World-View-Projection Matrix", by Gribb and Hartmann. It's available online, and gives a fairly clear explanation of how the algorithm is derived.

##### Share on other sites
Thanks. That's exactly what I was looking for.

1. 1
Rutin
22
2. 2
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633306
• Total Posts
3011287
• ### Who's Online (See full list)

There are no registered users currently online

×