google search

Wednesday, October 6, 2010

CLIPPING PLANE

Clipping planes can be used in addition of those used created for the viewing volume. OpenGL define 6 clipping plane GL_CLIP_PLANEi (i goes from 0 to 5).
A clipping plane is a plane that separate the space in two regions. One region is included from the viewing volume, the other is excluded.

In mathematics, a plane is defined by this equation :
    a*x+b*y+c*z+d = 0
(x, y, z) are the coordinates of the points in the 3D space. All points that verify this equation are on the plane.
The inequality (< or > instead of =) define the region in each side of the plane.

In OpenGL, a clipping plane is the region defined by this equation :
    a*x+b*y+c*z+d >= 0
A clipping plane is creates with the 4 values a, b, c & d likethis :
    double[] eq = {a, b, c, d}
    gl.glClipPlane(GL_CLIP_PLANEieq)    

All points draw , the other are excluded (will not be rendered on the screen).

Like for lights, clipping planes have to be enable to be active :
    gl.glEnable(GL_CLIP_PLANEi) 

0 comments:

  © Blogger templates ProBlogger Template by Ourblogtemplates.com 2008

Back to TOP