🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Frustum Normal Formula Derivation Help

Started by
1 comment, last by Zakwayda 5 years, 9 months ago

In this paper:http://fabiensanglard.net/polygon_codec/clippingdocument/Clipping.pdf

I can't deduce these formulas which about frustum planes normal, can anyone give me some tips?

etc:top normal vector  < 0, − cos(a/2) , − sin(a/2)>

 

Thanks!

Capture.PNG

Advertisement

Assuming I'm correctly understanding what you've posted, it looks like the normals are derived as follows. Consider the top plane. Let alpha equal half the vertical field of view. First, compute a unit-length vector that lies in the top plane and also lies in the yz plane. Using basic trig, you can see that one of the vectors satisfying these requirements has a z component of -cos(alpha) and a y component of sin(alpha), which gives:


0 sin(alpha) -cos(alpha)

Applying the 'perp' operation rotates this vector 90 degrees around the x axis, giving:


0 cos(alpha) sin(alpha)

This is normal to the plane, and points outward relative to the frustum. Negating it gives you the result from the paper (the inward-pointing normal).

A similar procedure for the bottom plane goes like this:


0 -sin(alpha) -cos(alpha)

0 cos(alpha) -sin(alpha)

In this case the initial 90-degree rotation gives the desired result, so no negation is necessary.

The normals for the left and right planes are derived similarly.

That's what it looks like to me at least, but as always it's possible I've misunderstood something or made an error somewhere.

This topic is closed to new replies.

Advertisement