문제

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.

도움이 되었습니까?

해결책

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top