[vtkusers] RE:Trying using glClipPlane in VTK
Mathieu Malaterre
mathieu.malaterre at kitware.com
Mon Nov 13 10:13:25 EST 2006
Hi Jerome,
To use the hardware clipping planes in VTK you need to defines clipping
planes via the vtkAbstractMapper::SetClippingPlanes.
HTH
Mathieu
Hummel, Jerome wrote:
> Hello again,
>
> Never mind!! I got it working. I needed to get the view transformation matrix
> from the camera to transform the plane eqaution first before passing it on the
> Ogl.
>
> -Jerome
>
>
>
>
> Hello all,
>
> I would like to try and improve performances with clipping.
> It seems vtk is doing a software clipping so i am trying to test hardware
> clipping using OpenGL glClipPlane function.
> I am using a PlaneWidget to define the plane equation.
> The problem is that the plane does not take into account the current
> transformation matrix so the plane does not move with the object when rotating
> it or translating it with an interactor. Does anybody know what I should do to
> make the plane take account of the current model view projection matrix ?
> Here is the code I use when the plane widget receive an end interaction event :
> PlaneWidget->GetCenter(center);
> PlaneWidget->GetNormal(normalVector);
> delta = normalVector[0] * center[0] + normalVector[1] * center[1] +
> normalVector[2] * center[2];
>
> GLdouble planeEquation[4];
> planeEquation[0] = normalVector[0];
> planeEquation[1] = normalVector[1];
> planeEquation[2] = normalVector[2];
> planeEquation[3] = -delta;
> glClipPlane((GLenum)(GL_CLIP_PLANE0), planeEquation);
>
> if(!glIsEnabled((GLenum)(GL_CLIP_PLANE0)))
> glEnable((GLenum)(GL_CLIP_PLANE0));
>
> thanks in advance
> -Jerome
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list