View Full Version : Orthographic: clipping a region

04-03-2005, 08:31 PM
Hi! I'm doing some rendering in glOrtho mode :P
I was wondering, how can draw something in a way that only things inside a given rectangle are really drawn ?
Something like clipping.

Thanks !

04-03-2005, 10:14 PM
You can specify clip planes with glClipPlane, but a much more universal way would be to draw the form you want clipping against in the stencil buffer and then use stencil testing while drawing.

04-03-2005, 10:28 PM
Also after setting up the clip plane with glClipPlane you can use glEnable(GL_CLIP_PLANE#)/glDisable(GL_CLIP_PLANE#) for quick switching.