I'm trying to get a handle on frustum culling, but I'm not quite there yet.
I have a camera in three-dimensional space
Camera position (cx, cy, cz) rotation (tx, ty, tz) fieldofview near-plane far-plane
and a quadtree containing my chunks of terrain
Quadtree Chunk bottomleft (x, y) width length heightmap
Currently, I am rendering every chunk within the quadtree. However, I would like to cull all chunks outside the six planes of the camera's frustum.
I am unsure how to:
- Generate these planes given the information in the camera class.
- Efficiently test for intersection using my quadtree. If one region of the quadtree fails, do all of its children (that seems reasonable, I just want to make sure)? What is the process for running through a quadtree for culling?
- Perform the intersection test using the planes and my terrain chunks. How do I quickly tell if a piece of terrain (square with varying y values) lies within the 6 camera planes?