[vtkusers] Transform a clipping plane

WangQ wangq1979 at outlook.com
Tue Jan 5 12:39:52 EST 2016


Dear Cory,
Thanks for the help. Now it is working! The only thing is that the origin needs to be transformed as well.
Cheers,
Qiang

Date: Tue, 5 Jan 2016 10:28:33 -0500
Subject: Re: [vtkusers] Transform a clipping plane
From: cory.quammen at kitware.com
To: wangq1979 at outlook.com
CC: vtkusers at vtk.org

Chiang,
The transform is applied to points at which the plane function is evaluated, but it is not considered when setting up clipping planes in the mapper.
You should be able to get the same effect from your rotations by applying the transform to a point representing the tip of the plane normal.
double normal[] = {0, 1, 0};double rotatedNormal[3];transPlane->TransformPoint(normal, rotatedNormal);plane->SetNormal(rotatedNormal);
HTH,Cory

On Tue, Jan 5, 2016 at 7:32 AM, WangQ <wangq1979 at outlook.com> wrote:



Hello vtkusers,
I used vtkplane to clip a volume. Everything is find until the volume is transformed. The plane is still at the original position. I then applied vtkTransform to the plane, but the plane is still the same place. The code snippet is as below:
    vtkSmartPointer<vtkPlane> plane =        vtkSmartPointer<vtkPlane>::New();    plane->SetOrigin(0, tomo2DDims / 2, 0);    plane->SetNormal(0, 1, 0);    vtkSmartPointer<vtkTransform> transPlane = vtkSmartPointer<vtkTransform>::New();    transPlane->RotateY(90);    transPlane->RotateZ(90);    transPlane->RotateX(55);    transPlane->RotateY(3);    plane->SetTransform(transPlane);
    cutVolumeMapper->AddClippingPlane(plane);

Appreciate your help in advance!
cheers,
Chiang 		 	   		  

_______________________________________________

Powered by www.kitware.com



Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html



Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ



Search the list archives at: http://markmail.org/search/?q=vtkusers



Follow this link to subscribe/unsubscribe:

http://public.kitware.com/mailman/listinfo/vtkusers




-- 
Cory Quammen
R&D Engineer
Kitware, Inc.
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160106/1b7ef5c9/attachment.html>


More information about the vtkusers mailing list