Lorenzo T - 2015-09-11

Hi All,
I used TGLDirectOpenGL to setup clipping planes but I can't switch off clipping ...

Var
clip0 : Array [0..3] Of Double = (-1.0, 0.0, 0.0, 1 / 2.0);
clip1 : Array [0..3] Of Double = (1.0, 0.0, 0.0, 1 / 2.0);
clip2 : Array [0..3] Of Double = (0.0, -1.0, 0.0, 1 / 2.0);
clip3 : Array [0..3] Of Double = (0.0, 1.0, 0.0, 1 / 2.0);
clip4 : Array [0..3] Of Double = (0.0, 0.0, -1.0, 1 / 2.0);
clip5 : Array [0..3] Of Double = (0.0, 0.0, 1.0, 1 / 2.0);

Procedure TForm1.GLDirectOpenGLRender(Sender: TObject; var rci: TRenderContextInfo);

Begin
if do_clip then
begin
gl.ClipPlane(GL_CLIP_PLANE0, @clip0);
gl.ClipPlane(GL_CLIP_PLANE1, @clip1);
gl.ClipPlane(GL_CLIP_PLANE2, @clip2);
gl.ClipPlane(GL_CLIP_PLANE3, @clip3);
gl.ClipPlane(GL_CLIP_PLANE4, @clip4);
gl.ClipPlane(GL_CLIP_PLANE5, @clip5);

 gl.Enable(GL_CLIP_PLANE0);
 gl.Enable(GL_CLIP_PLANE1);
 gl.Enable(GL_CLIP_PLANE2);
 gl.Enable(GL_CLIP_PLANE3);
 gl.Enable(GL_CLIP_PLANE4);
 gl.Enable(GL_CLIP_PLANE5);
end;

End;

Thanks for Help !!