From Ohm

# Clip Planes

Iso surfaces are nested (onion shells). To see the inner shells it is often necessary to remove tissue that is occluding the inner parts. This is done via:

• Preprocessing the volume
• Segmentation techniques
• On-the-fly
• Clipping planes
• Clipping volumes
• Semi-transparent iso-surfaces
• Depth Peeling

A clip plane removes the geometry on one side of the plane.

With OpenGL at least 6 independent clipping planes can be specified for the hardware pipeline.

A single OpenGL clip plane is defined by the plane equation

$ax+by+cz+d = 0$

When evaluating the above formula for points (x,y,z), results less or greater than zero indicate points on one or the other side of the plane.

For a plane with pivot point $\vec{p}$ and a normal $\vec{n}$ (pointing into the half space that is to be shown) the plane coefficients are:

• $a = \vec{n_x}$
• $b = \vec{n_y}$
• $c = \vec{n_z}$
• $d = - \vec{n}\cdot\vec{p}$

The i-th OpenGL clip plane is specified via:

GLdouble equ[4];

equ[0]=a;
equ[1]=b;
equ[2]=c;
equ[3]=d;

glClipPlane(GL_CLIP_PLANE0+i,equ);
glEnable(GL_CLIP_PLANE0+i);