The technique used to eliminate non-visible triangles is known as Backface Culling. It involves projecting three 3D points onto a 2D screen and determining their arrangement as either clockwise or counter-clockwise. By analyzing the direction of the Normal Vector, which either extends into or out of the screen, it can be determined if a triangle is facing the front or back side. Triangles facing the back side are simply discarded.
While this method is straightforward, the challenge arises when dealing with convex/concave 3D polyhedra. In such cases, it becomes complex to ascertain whether a front-facing triangle is obstructed by other triangles within the same structure.
For instance, consider the situation where a rectangle R is positioned behind a U-shaped structure:
+--------+
| |
| +--+ |
| | | | <-- Rectangle R is visible through the U shape
| | | |
+--+ +--+
Here, the task involves determining if the rectangle R is completely obscured by the U shape or if parts of it remain visible by computing the intersections of the two polygons.
As the complexity of polyhedra increases, the algorithm needed to determine visibility also becomes more intricate. Hence, this approach may not be suitable unless real-time performance is not a concern, and it may not necessarily be graphics-related.
In computer graphics, a Z-buffer is commonly employed to render all front-facing triangles, following backface culling. This involves storing the depth values in a buffer and checking the Z values while rendering pixels to determine visibility.
Real-time visibility analysis, particularly at 60 Hertz, is challenging without rendering all triangles using Z-buffer on current GPU hardware. While CPU-based algorithms can perform visibility checks, they are considerably complex and require extensive study to implement effectively.
Backface culling provides a quick and rudimentary solution, while visibility checking is a highly intricate process that may necessitate external tools. The Z-buffer method, on the other hand, involves rendering triangles and is not primarily an optimization technique for avoiding unnecessary geometry rendering.