Question

Anyone have links to tutorials on this topic? I cannot seem to find any related to 2d culling. Or if anyone here could explain how it's done. I use gluOrtho2D and gluLookAt currently.

Was it helpful?

Solution

GL shouldn't be drawing outside of the clipping planes that you defined in gluOrtho2D

One way to convince yourself of this is to compare the frame rate you get when you display a portion of the map vs. zooming out and displaying the entire map.

For larger scenes, this may not be enough. In that case, determine which polygons are completely outside of the viewing frustum with code like in:

http://web.archive.org/web/20030207104008/http://www.markmorley.com/opengl/frustumculling.html

OTHER TIPS

If you mean geometry culling, then wouldn't it be just as simple as checking if the polygon you are drawing lies outside of the rectangle defined by your gluOrtho2D and gluLookAt? If it's outside, then don't draw it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top