In my previous post on horizon culling we talked about what horizon culling is, the reasons one might want to do it, and went over a simple C# vector class. In this post we’ll take a look at the math we’ll need to use.
In 3D graphics, a technique that’s often used to improve performance is called culling. Culling means to reduce the population of a wild animal by selective slaughter. It also means, and this is the definition we’ll be using here, to select from a large quantity. For Horizon Culling, the large quantity we’ll be selecting from is the tens of thousands of triangles used to draw a spherical planet. And we’ll be using the horizon to determine which triangles to cull.
I’ve always considered programming an art form. As a result, I try to create code that is clean, readable, and easy to follow – just the way I like my art. I don’t like crappy art, and don’t like crappy code either.