How to clip only intersection (not union) of clipping planes?
问题 In OpenGL/JOGL, when using more than one clipping plane, the union of all clipping planes appears to be applied. What I want is instead the intersection of all clipping planes to be applied. Is this possible? See the below simplified 2-D example. Edit: An example of clipping by vertex shader (see comments below). 回答1: Multi-pass: #include <GL/glut.h> void scene() { glColor3ub( 255, 0, 0 ); glBegin( GL_QUADS ); glVertex2i( -1, -1 ); glVertex2i( 1, -1 ); glVertex2i( 1, 1 ); glVertex2i( -1, 1 );