Réf:Re: [vtkusers] RE:Trying using glClipPlane in VTK

Hummel, Jerome Jerome.Hummel at fr.michelin.com
Tue Nov 14 03:00:23 EST 2006



Hi Mathieu,

does this mean that if you want a plane to clip all actors in your scene you
need to set the clipping planes to all mappers ?

What I did is that I plugged a command to be called whenever a given renderer is
about to be updated (or all its actors rendered). The command is called when the
event starts and sets the clipping plane. When the event ends the clipping plane
is removed. This in turns clipps all actors handled by the renderer (and by
setting the plane only once). Others actors are not clipped (e.g. a 2D color
bar).

regards,
-Jerome

____________________Séparateur de messages____________________
Objet : Re: [vtkusers] RE:Trying using glClipPlane in VTK
Auteur :    mathieu.malaterre at kitware.com
Date :  13/11/2006 17:01

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
>

_______________________________________________
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