Original Post
I'm quite new to 3D programming, so stop me if you've heard this one before! Standard backface culling iterates through a set of polygons, calculates the view vector, and calculates the dot product of the the view and normal vectors. I am looking for a way to remove the requirement of iterating through all of the polygons and returning all front-facing vertices in a single operation. I have come up with the following incomplete solution: Each vertex object has a pointer to the polygons it is a member of. The vertices are stored in a sorted map (angle->vertices). If we take a 2D view, you can see that if you are looking from 0deg, you can get all of the visible vertices by returning a sub-map of angles between 270-90deg. For large objects, the view vector may vary too much accross the object, so some level of error, and/or multiple vector maps, would be required depending on view distance. The problem I am having is in finding a data structure to store the map in 3D. Standard polar coordinates have a problem of being able to see back facing normals when you look over the top if they are only just backfacing, so you can't use a simple 2 pass check. I need an efficient way of determining the sub-map. Any ideas?