Hi,<div><br></div><div>I'm trying to render a 2D view of vtkCutter applied to polydata. The polydata is cut perpendicular to its y axis. </div><div><br></div><div>If I do the following:</div><div><br></div><div>
<pre style="margin-top:0px;margin-bottom:0px">ren<span style="color:#aaaaaa">-></span>ResetCamera<span style="color:#aaaaaa">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px">ren<span style="color:rgb(170,170,170)">-></span>GetRenderWindow<span style="color:rgb(170,170,170)">()-></span><span style="font-style:italic">Render</span><span style="color:rgb(170,170,170)">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(170,170,170)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal">I see a thin line (the cut is seen on the xy plane), but I want to see it on the xz plane. So I do the following:</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="arial"><span style="white-space:normal"><br></span></font></pre><pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px">mAxialPlane<span style="color:#aaaaaa">-></span><span style="font-style:italic">GetNormal</span><span style="color:#aaaaaa">(</span>normal<span style="color:#aaaaaa">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px">mAxialCutter<span style="color:#aaaaaa">-></span>GetOutput<span style="color:#aaaaaa">()-></span>GetCenter<span style="color:#aaaaaa">(</span>position<span style="color:#aaaaaa">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px">ren<span style="color:#aaaaaa">-></span>ResetCamera<span style="color:#aaaaaa">();</span></pre><pre style="margin-top:0px;margin-bottom:0px"></pre><pre style="margin-top:0px;margin-bottom:0px">
ren<span style="color:#aaaaaa">-></span>GetActiveCamera<span style="color:#aaaaaa">()-></span>SetPosition<span style="color:#aaaaaa">(</span>position<span style="color:#aaaaaa">[</span><span style="color:#ff55ff">0</span><span style="color:#aaaaaa">]+</span>normal<span style="color:#aaaaaa">[</span><span style="color:#ff55ff">0</span><span style="color:#aaaaaa">],</span><span style="color:#c0c0c0"> </span>position<span style="color:#aaaaaa">[</span><span style="color:#ff55ff">1</span><span style="color:#aaaaaa">]+</span>normal<span style="color:#aaaaaa">[</span><span style="color:#ff55ff">1</span><span style="color:#aaaaaa">],</span><span style="color:#c0c0c0"> </span>position<span style="color:#aaaaaa">[</span><span style="color:#ff55ff">2</span><span style="color:#aaaaaa">]+</span>normal<span style="color:#aaaaaa">[</span><span style="color:#ff55ff">2</span><span style="color:#aaaaaa">]);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px">ren<span style="color:#aaaaaa">-></span>GetActiveCamera<span style="color:#aaaaaa">()-></span>SetFocalPoint<span style="color:#aaaaaa">(</span>position<span style="color:#aaaaaa">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px">ren<span style="color:#aaaaaa">-></span>GetActiveCamera<span style="color:#aaaaaa">()-></span><span style="font-style:italic">ParallelProjectionOn</span><span style="color:#aaaaaa">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px">ren<span style="color:rgb(170,170,170)">-></span>GetActiveCamera<span style="color:rgb(170,170,170)">()-></span>SetViewUp<span style="color:rgb(170,170,170)">(</span><span style="color:rgb(255,85,255)">0.0</span><span style="color:rgb(170,170,170)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(255,85,255)">0.0</span><span style="color:rgb(170,170,170)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(255,85,255)">1.0</span><span style="color:rgb(170,170,170)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px">ren<span style="color:#aaaaaa">-></span>GetRenderWindow<span style="color:#aaaaaa">()-></span><span style="font-style:italic">Render</span><span style="color:#aaaaaa">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#aaaaaa"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal">I have found two problems:</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal">1) If I set the UP vector with </span><span style="background-color:rgb(226,232,242);color:rgb(37,53,85);font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:13px;font-weight:bold;line-height:16px;white-space:nowrap"> </span><a class="el" href="http://www.vtk.org/doc/nightly/html/classvtkCamera.html#ac00519491b0af991462f8660d75a0aac" style="background-color:rgb(226,232,242);color:rgb(70,101,162);font-weight:bold;text-decoration:none;font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:13px;line-height:16px;white-space:nowrap">vtkCamera::OrthogonalizeViewUp</a> the result is the vector (0, 0, 0) and, of course, I don't see anything.</pre>
<pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal">1) If I set</span><span style="font-family:arial;white-space:normal"> the ViweUp vector as I do it in the code above, I have to rotate a little bit the view with the interactor and the image suddenly appears. It appears in the position and view I was expecting, but why should I manually rotate it just a little for it to appear (moreover, when this is working I will disable the rotation with my own interactor style).</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal">I would really appreciate any hint.</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal">Thanks in advance,</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal">Federico</span></pre>
</pre></pre></pre></div>