<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:΢ÈíÑźÚ
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Dear Cory,<div><br></div><div>I try to use 2 perpendicular planes to clip a volume to achieve something shown in the attachment, i.e. clipping 1/4 of a volume. But the result <span style="font-size: 12pt;">unfortunately</span><span style="font-size: 12pt;"> </span><span style="font-size: 12pt;"> is reverse, i.e. clipping 3/4 away, and showing the rest 1/4. Do you have any suggestion?</span></div><div><span style="font-size: 12pt;"><br></span></div><div><span style="font-size: 12pt;">Many thanks!</span></div><div><span style="font-size: 12pt;"><br></span></div><div>Chiang</div><div><br><div><hr id="stopSpelling">Date: Tue, 5 Jan 2016 10:28:33 -0500<br>Subject: Re: [vtkusers] Transform a clipping plane<br>From: cory.quammen@kitware.com<br>To: wangq1979@outlook.com<br>CC: vtkusers@vtk.org<br><br><div dir="ltr">Chiang,<div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>double normal[] = {0, 1, 0};</div><div>double rotatedNormal[3];</div><div>transPlane->TransformPoint(normal, rotatedNormal);</div><div>plane->SetNormal(rotatedNormal);</div><div><br></div><div>HTH,</div><div>Cory</div><div><br></div></div><div class="ecxgmail_extra"><br><div class="ecxgmail_quote">On Tue, Jan 5, 2016 at 7:32 AM, WangQ <span dir="ltr"><<a href="mailto:wangq1979@outlook.com" target="_blank">wangq1979@outlook.com</a>></span> wrote:<br><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex;">
<div><div dir="ltr">Hello vtkusers,<div><br></div><div>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:</div><div><br></div><div><div> vtkSmartPointer<vtkPlane> plane =</div><div> vtkSmartPointer<vtkPlane>::New();</div><div> plane->SetOrigin(0, tomo2DDims / 2, 0);</div><div> plane->SetNormal(0, 1, 0);</div><div> vtkSmartPointer<vtkTransform> transPlane = vtkSmartPointer<vtkTransform>::New();</div><div> transPlane->RotateY(90);</div><div> transPlane->RotateZ(90);</div><div> transPlane->RotateX(55);</div><div> transPlane->RotateY(3);</div><div> plane->SetTransform(transPlane);</div><div><br></div><div> cutVolumeMapper->AddClippingPlane(plane);</div></div><div><br></div><div><br></div><div>Appreciate your help in advance!</div><div><br></div><div>cheers,</div><div><br></div><div>Chiang</div> </div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="ecxgmail_signature">Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</div></div></div> </div></body>
</html>