<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi John,<br>
<br>
Is that the same as ResetCamera? If not, how is it different and
where can I find the code for it in ParaView? Maybe I can add that
also.<br>
<br>
Thanks.<br>
<br>
<div class="moz-cite-prefix">On 8/20/2013 5:27 PM, John Platt wrote:<br>
</div>
<blockquote cite="mid:99D753FFC03249F7907D418EA25C004A@pafec5"
type="cite">
<title>Snippet</title>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<meta name="GENERATOR" content="MSHTML 8.00.6001.23515">
<style></style>
<div><font size="2" face="Arial">
<div><font size="2" face="Arial">
<div><font size="2" face="Arial">Hi Serge,</font></div>
<div> </div>
<div><font size="2" face="Arial">If it helps your sanity,
I can repeat this clipping problem in VTK 5.10 using
the default interactor with QVTKWidget, which I
believe is trackball camera, and parallel projection
on.</font></div>
<div> </div>
<div><font size="2" face="Arial">When this happens, I have
a 'Fit' option which moves the focal point of the
camera to the centre of the actors and adjusts the
parallel scale to fill the view.</font></div>
<div> </div>
<div><font size="2" face="Arial">John.</font></div>
</font></div>
</font></div>
<blockquote style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT:
5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<div style="FONT: 10pt arial">----- Original Message ----- </div>
<div style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color:
black"><b>From:</b> <a moz-do-not-send="true"
title="serge@infolytica.com"
href="mailto:serge@infolytica.com">Serge Lalonde</a> </div>
<div style="FONT: 10pt arial"><b>To:</b> <a
moz-do-not-send="true" title="vtkusers@vtk.org"
href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a> </div>
<div style="FONT: 10pt arial"><b>Sent:</b> Tuesday, August 20,
2013 8:12 PM</div>
<div style="FONT: 10pt arial"><b>Subject:</b> Re: [vtkusers]
Clipping problem when panning</div>
<div><br>
</div>
Well, since I got no responses, I dug deeper and found the code
in ParaView that does the rotation and spinning around the
center of the visible actors, extracted it and put it into a
vtkInteractorStyleTrackballCamera subclass. It hasn't been
extensively tested yet, but it seems to work well.<br>
<br>
Here it is in case it helps save anybody else 3 days of work.<br>
<br>
<pre style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 13px"> <span style="COLOR: green">// Our subclass of the trackball camera to change the center of rotation to be the average</span>
<span style="COLOR: green">// center of all visible actors instead of the center of the viewport, which always gets clipped.</span>
<span style="COLOR: green">// The default implementation is badly broken and doesn't look to be fixed anytime soon.</span>
<span style="COLOR: green">// The clipping might be fixed with the changes I submitted: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.vtk.org/Bug/view.php?id=7823">http://www.vtk.org/Bug/view.php?id=7823</a></span>
<span style="COLOR: green">// The new rotation code was taken from ParaView. Specifically,</span>
<span style="COLOR: green">// - Rotate(): vtkPVTrackballRotate.cxx OnMouseMove()</span>
<span style="COLOR: green">// - Spin(): vtkPVTrackballRoll.cxx OnMouseMove()</span>
<span style="COLOR: green">// - UpdateScreenCenterOfRotation(): vtkCameraManipulator.cxx ComputeDisplayCenter()</span>
<span style="COLOR: blue">class</span> <span style="COLOR: blue">InteractorStyleTrackballCamera</span>: <span style="COLOR: blue">public</span> <span style="COLOR: blue">vtkInteractorStyleTrackballCamera</span>
{
<span style="COLOR: blue">public</span>:
<span style="COLOR: blue">static</span> <span style="COLOR: blue">InteractorStyleTrackballCamera</span> *<span style="COLOR: #880000">New</span>();
<span style="COLOR: #a000a0">vtkTypeMacro</span>(<span style="COLOR: blue">InteractorStyleTrackballCamera</span>, <span style="COLOR: blue">vtkInteractorStyleTrackballCamera</span>);
<span style="COLOR: green">// This only gets called is CurrentRenderer isn't NULL.</span>
<span style="COLOR: blue">virtual</span> <span style="COLOR: blue">void</span> <span style="COLOR: #880000">StartRotate</span>()
{
<span style="COLOR: blue">Superclass</span>::<span style="COLOR: #880000">StartRotate</span>();
<span style="COLOR: #880000">UpdateCenterOfRotation</span>(<span style="COLOR: navy">CurrentRenderer</span>);
}
<span style="COLOR: green">// This only gets called is CurrentRenderer isn't NULL.</span>
<span style="COLOR: blue">virtual</span> <span style="COLOR: blue">void</span> <span style="COLOR: #880000">StartSpin</span>()
{
<span style="COLOR: blue">Superclass</span>::<span style="COLOR: #880000">StartSpin</span>();
<span style="COLOR: #880000">UpdateCenterOfRotation</span>(<span style="COLOR: navy">CurrentRenderer</span>);
<span style="COLOR: #880000">UpdateScreenCenterOfRotation</span>(<span style="COLOR: navy">CurrentRenderer</span>);
}
<span style="COLOR: blue">virtual</span> <span style="COLOR: blue">void</span> <span style="COLOR: #880000">Rotate</span>()
{
<span style="COLOR: blue">if</span> (<span style="COLOR: navy">CurrentRenderer</span> == <span style="COLOR: #a000a0">NULL</span>)
<span style="COLOR: blue">return</span>;
<span style="COLOR: blue">vtkRenderer</span> *<span style="COLOR: navy">ren</span>= <span style="COLOR: navy">CurrentRenderer</span>;
<span style="COLOR: blue">vtkCamera</span> *<span style="COLOR: navy">camera</span>= <span style="COLOR: navy">ren</span>-><span style="COLOR: #880000">GetActiveCamera</span>();
<span style="COLOR: blue">vtkRenderWindowInteractor</span> *<span style="COLOR: navy">rwi</span>= <span style="COLOR: navy">Interactor</span>;
<span style="COLOR: blue">vtkTransform</span> *<span style="COLOR: navy">transform</span>= <span style="COLOR: blue">vtkTransform</span>::<span style="COLOR: #880000">New</span>();
<span style="COLOR: blue">double</span> <span style="COLOR: navy">scale</span>= <span style="COLOR: blue">vtkMath</span>::<span style="COLOR: #880000">Norm</span>(<span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">GetPosition</span>());
<span style="COLOR: blue">if</span> (<span style="COLOR: navy">scale</span> <= 0.0)
{
<span style="COLOR: navy">scale</span>= <span style="COLOR: blue">vtkMath</span>::<span style="COLOR: #880000">Norm</span>(<span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">GetFocalPoint</span>());
<span style="COLOR: blue">if</span> (<span style="COLOR: navy">scale</span> <= 0.0)
<span style="COLOR: navy">scale</span>= 1.0;
}
<span style="COLOR: blue">double</span> *<span style="COLOR: navy">temp</span>= <span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">GetFocalPoint</span>();
<span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">SetFocalPoint</span>(<span style="COLOR: navy">temp</span>[0]/<span style="COLOR: navy">scale</span>, <span style="COLOR: navy">temp</span>[1]/<span style="COLOR: navy">scale</span>, <span style="COLOR: navy">temp</span>[2]/<span style="COLOR: navy">scale</span>);
<span style="COLOR: navy">temp</span>= <span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">GetPosition</span>();
<span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">SetPosition</span>(<span style="COLOR: navy">temp</span>[0]/<span style="COLOR: navy">scale</span>, <span style="COLOR: navy">temp</span>[1]/<span style="COLOR: navy">scale</span>, <span style="COLOR: navy">temp</span>[2]/<span style="COLOR: navy">scale</span>);
<span style="COLOR: blue">double</span> <span style="COLOR: navy">v2</span>[3];
<span style="COLOR: green">// translate to center</span>
<span style="COLOR: navy">transform</span>-><span style="COLOR: #880000">Identity</span>();
<span style="COLOR: navy">transform</span>-><span style="COLOR: #880000">Translate</span>(<span style="COLOR: navy">m_center</span>[0]/<span style="COLOR: navy">scale</span>, <span style="COLOR: navy">m_center</span>[1]/<span style="COLOR: navy">scale</span>, <span style="COLOR: navy">m_center</span>[2]/<span style="COLOR: navy">scale</span>);
<span style="COLOR: blue">int</span> <span style="COLOR: navy">dx</span>= <span style="COLOR: navy">rwi</span>-><span style="COLOR: #880000">GetLastEventPosition</span>()[0] - <span style="COLOR: navy">rwi</span>-><span style="COLOR: #880000">GetEventPosition</span>()[0];
<span style="COLOR: blue">int</span> <span style="COLOR: navy">dy</span>= <span style="COLOR: navy">rwi</span>-><span style="COLOR: #880000">GetLastEventPosition</span>()[1] - <span style="COLOR: navy">rwi</span>-><span style="COLOR: #880000">GetEventPosition</span>()[1];
<span style="COLOR: green">// azimuth</span>
<span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">OrthogonalizeViewUp</span>();
<span style="COLOR: blue">double</span> *<span style="COLOR: navy">viewUp</span>= <span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">GetViewUp</span>();
<span style="COLOR: blue">int</span> *<span style="COLOR: navy">size</span>= <span style="COLOR: navy">ren</span>-><span style="COLOR: #880000">GetSize</span>();
<span style="COLOR: navy">transform</span>-><span style="COLOR: #880000">RotateWXYZ</span>(360.0*<span style="COLOR: navy">dx</span>/<span style="COLOR: navy">size</span>[0], <span style="COLOR: navy">viewUp</span>[0], <span style="COLOR: navy">viewUp</span>[1], <span style="COLOR: navy">viewUp</span>[2]);
<span style="COLOR: green">// elevation</span>
<span style="COLOR: blue">vtkMath</span>::<span style="COLOR: #880000">Cross</span>(<span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">GetDirectionOfProjection</span>(), <span style="COLOR: navy">viewUp</span>, <span style="COLOR: navy">v2</span>);
<span style="COLOR: navy">transform</span>-><span style="COLOR: #880000">RotateWXYZ</span>(-360.0*<span style="COLOR: navy">dy</span>/<span style="COLOR: navy">size</span>[1], <span style="COLOR: navy">v2</span>[0], <span style="COLOR: navy">v2</span>[1], <span style="COLOR: navy">v2</span>[2]);
<span style="COLOR: green">// translate back</span>
<span style="COLOR: navy">transform</span>-><span style="COLOR: #880000">Translate</span>(-<span style="COLOR: navy">m_center</span>[0]/<span style="COLOR: navy">scale</span>, -<span style="COLOR: navy">m_center</span>[1]/<span style="COLOR: navy">scale</span>, -<span style="COLOR: navy">m_center</span>[2]/<span style="COLOR: navy">scale</span>);
<span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">ApplyTransform</span>(<span style="COLOR: navy">transform</span>);
<span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">OrthogonalizeViewUp</span>();
<span style="COLOR: green">// For rescale back.</span>
<span style="COLOR: navy">temp</span>= <span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">GetFocalPoint</span>();
<span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">SetFocalPoint</span>(<span style="COLOR: navy">temp</span>[0]*<span style="COLOR: navy">scale</span>, <span style="COLOR: navy">temp</span>[1]*<span style="COLOR: navy">scale</span>, <span style="COLOR: navy">temp</span>[2]*<span style="COLOR: navy">scale</span>);
<span style="COLOR: navy">temp</span>= <span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">GetPosition</span>();
<span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">SetPosition</span>(<span style="COLOR: navy">temp</span>[0]*<span style="COLOR: navy">scale</span>, <span style="COLOR: navy">temp</span>[1]*<span style="COLOR: navy">scale</span>, <span style="COLOR: navy">temp</span>[2]*<span style="COLOR: navy">scale</span>);
<span style="COLOR: navy">ren</span>-><span style="COLOR: #880000">ResetCameraClippingRange</span>();
<span style="COLOR: navy">rwi</span>-><span style="COLOR: #880000">Render</span>();
<span style="COLOR: navy">transform</span>-><span style="COLOR: #880000">Delete</span>();
}
<span style="COLOR: blue">virtual</span> <span style="COLOR: blue">void</span> <span style="COLOR: #880000">Spin</span>()
{
<span style="COLOR: blue">if</span> (<span style="COLOR: navy">CurrentRenderer</span> == <span style="COLOR: #a000a0">NULL</span>)
<span style="COLOR: blue">return</span>;
<span style="COLOR: blue">vtkRenderer</span> *<span style="COLOR: navy">ren</span>= <span style="COLOR: navy">CurrentRenderer</span>;
<span style="COLOR: blue">vtkCamera</span> *<span style="COLOR: navy">camera</span>= <span style="COLOR: navy">ren</span>-><span style="COLOR: #880000">GetActiveCamera</span>();
<span style="COLOR: blue">vtkRenderWindowInteractor</span> *<span style="COLOR: navy">rwi</span>= <span style="COLOR: navy">Interactor</span>;
<span style="COLOR: blue">double</span> <span style="COLOR: navy">axis</span>[3];
<span style="COLOR: green">// compute view vector (rotation axis)</span>
<span style="COLOR: blue">double</span> *<span style="COLOR: navy">pos</span>= <span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">GetPosition</span>();
<span style="COLOR: blue">double</span> *<span style="COLOR: navy">fp</span>= <span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">GetFocalPoint</span>();
<span style="COLOR: navy">axis</span>[0]= <span style="COLOR: navy">fp</span>[0] - <span style="COLOR: navy">pos</span>[0];
<span style="COLOR: navy">axis</span>[1]= <span style="COLOR: navy">fp</span>[1] - <span style="COLOR: navy">pos</span>[1];
<span style="COLOR: navy">axis</span>[2]= <span style="COLOR: navy">fp</span>[2] - <span style="COLOR: navy">pos</span>[2];
<span style="COLOR: blue">int</span> <span style="COLOR: navy">x1</span>, <span style="COLOR: navy">x2</span>, <span style="COLOR: navy">y1</span>, <span style="COLOR: navy">y2</span>;
<span style="COLOR: navy">x1</span>= <span style="COLOR: navy">rwi</span>-><span style="COLOR: #880000">GetLastEventPosition</span>()[0] - (<span style="COLOR: blue">int</span>) <span style="COLOR: navy">m_display_center</span>[0];
<span style="COLOR: navy">x2</span>= <span style="COLOR: navy">rwi</span>-><span style="COLOR: #880000">GetEventPosition</span>()[0] - (<span style="COLOR: blue">int</span>) <span style="COLOR: navy">m_display_center</span>[0];
<span style="COLOR: navy">y1</span>= <span style="COLOR: navy">rwi</span>-><span style="COLOR: #880000">GetLastEventPosition</span>()[1] - (<span style="COLOR: blue">int</span>) <span style="COLOR: navy">m_display_center</span>[1];
<span style="COLOR: navy">y2</span>= <span style="COLOR: navy">rwi</span>-><span style="COLOR: #880000">GetEventPosition</span>()[1] - (<span style="COLOR: blue">int</span>) <span style="COLOR: navy">m_display_center</span>[1];
<span style="COLOR: blue">if</span> ((<span style="COLOR: navy">x2</span> == 0.0 && <span style="COLOR: navy">y2</span> == 0.0) || (<span style="COLOR: navy">x1</span> == 0.0 && <span style="COLOR: navy">y1</span> == 0.0))
{
<span style="COLOR: green">//don't ever want to divide by zero</span>
<span style="COLOR: blue">return</span>;
}
<span style="COLOR: green">// - divide by magnitudes to get angle</span>
<span style="COLOR: blue">double</span> <span style="COLOR: navy">angle</span>= <span style="COLOR: blue">vtkMath</span>::<span style="COLOR: #880000">DegreesFromRadians</span>((<span style="COLOR: navy">x1</span>*<span style="COLOR: navy">y2</span> - <span style="COLOR: navy">y1</span>*<span style="COLOR: navy">x2</span>)/(<span style="COLOR: #a000a0">sqrt</span>(<span style="COLOR: blue">static_cast</span><<span style="COLOR: blue">double</span>>(<span style="COLOR: navy">x1</span>*<span style="COLOR: navy">x1</span> + <span style="COLOR: navy">y1</span>*<span style="COLOR: navy">y1</span>))*<span style="COLOR: #a000a0">sqrt</span>(<span style="COLOR: blue">static_cast</span><<span style="COLOR: blue">double</span>>(<span style="COLOR: navy">x2</span>*<span style="COLOR: navy">x2</span> + <span style="COLOR: navy">y2</span>*<span style="COLOR: navy">y2</span>))));
<span style="COLOR: green">// translate to center</span>
<span style="COLOR: blue">vtkTransform</span> *<span style="COLOR: navy">transform</span>= <span style="COLOR: blue">vtkTransform</span>::<span style="COLOR: #880000">New</span>();
<span style="COLOR: navy">transform</span>-><span style="COLOR: #880000">Identity</span>();
<span style="COLOR: navy">transform</span>-><span style="COLOR: #880000">Translate</span>(<span style="COLOR: navy">m_center</span>[0], <span style="COLOR: navy">m_center</span>[1], <span style="COLOR: navy">m_center</span>[2]);
<span style="COLOR: green">// roll</span>
<span style="COLOR: navy">transform</span>-><span style="COLOR: #880000">RotateWXYZ</span>(<span style="COLOR: navy">angle</span>, <span style="COLOR: navy">axis</span>[0], <span style="COLOR: navy">axis</span>[1], <span style="COLOR: navy">axis</span>[2]);
<span style="COLOR: green">// translate back</span>
<span style="COLOR: navy">transform</span>-><span style="COLOR: #880000">Translate</span>(-<span style="COLOR: navy">m_center</span>[0], -<span style="COLOR: navy">m_center</span>[1], -<span style="COLOR: navy">m_center</span>[2]);
<span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">ApplyTransform</span>(<span style="COLOR: navy">transform</span>);
<span style="COLOR: navy">camera</span>-><span style="COLOR: #880000">OrthogonalizeViewUp</span>();
<span style="COLOR: navy">ren</span>-><span style="COLOR: #880000">ResetCameraClippingRange</span>();
<span style="COLOR: navy">rwi</span>-><span style="COLOR: #880000">Render</span>();
<span style="COLOR: navy">transform</span>-><span style="COLOR: #880000">Delete</span>();
}
<span style="COLOR: blue">protected</span>:
<span style="COLOR: blue">InteractorStyleTrackballCamera</span>()
{
<span style="COLOR: navy">m_center</span>[0]= <span style="COLOR: navy">m_center</span>[1]= <span style="COLOR: navy">m_center</span>[2]= <span style="COLOR: navy">m_display_center</span>[0]= <span style="COLOR: navy">m_display_center</span>[1]= 0;
}
<span style="COLOR: green">// Calculate the center of the visible actors.</span>
<span style="COLOR: blue">void</span> <span style="COLOR: #880000">UpdateCenterOfRotation</span>(<span style="COLOR: blue">vtkRenderer</span> *<span style="COLOR: navy">ren</span>)
{
<span style="COLOR: blue">vtkActorCollection</span> *<span style="COLOR: navy">actors</span>= <span style="COLOR: navy">ren</span>-><span style="COLOR: #880000">GetActors</span>();
<span style="COLOR: blue">vtkCollectionSimpleIterator</span> <span style="COLOR: navy">cookie</span>;
<span style="COLOR: blue">vtkActor</span> *<span style="COLOR: navy">actor</span>;
<span style="COLOR: navy">m_center</span>[0]= <span style="COLOR: navy">m_center</span>[1]= <span style="COLOR: navy">m_center</span>[2]= 0;
<span style="COLOR: navy">actors</span>-><span style="COLOR: #880000">InitTraversal</span>(<span style="COLOR: navy">cookie</span>);
<span style="COLOR: blue">while</span> ((<span style="COLOR: navy">actor</span>= <span style="COLOR: navy">actors</span>-><span style="COLOR: #880000">GetNextActor</span>(<span style="COLOR: navy">cookie</span>)) != <span style="COLOR: #a000a0">NULL</span>)
{
<span style="COLOR: blue">if</span> (<span style="COLOR: navy">actor</span>-><span style="COLOR: #880000">GetVisibility</span>())
{
<span style="COLOR: blue">double</span> *<span style="COLOR: navy">actor_center</span>= <span style="COLOR: navy">actor</span>-><span style="COLOR: #880000">GetCenter</span>();
<span style="COLOR: navy">m_center</span>[0]+= <span style="COLOR: navy">actor_center</span>[0];
<span style="COLOR: navy">m_center</span>[1]+= <span style="COLOR: navy">actor_center</span>[1];
<span style="COLOR: navy">m_center</span>[2]+= <span style="COLOR: navy">actor_center</span>[2];
}
}
<span style="COLOR: navy">m_center</span>[0]/= <span style="COLOR: navy">actors</span>-><span style="COLOR: #880000">GetNumberOfItems</span>();
<span style="COLOR: navy">m_center</span>[1]/= <span style="COLOR: navy">actors</span>-><span style="COLOR: #880000">GetNumberOfItems</span>();
<span style="COLOR: navy">m_center</span>[2]/= <span style="COLOR: navy">actors</span>-><span style="COLOR: #880000">GetNumberOfItems</span>();
}
<span style="COLOR: green">// Updates the screen center of rotation. Must be called after UpdateCenterOfRotation(),</span>
<span style="COLOR: blue">void</span> <span style="COLOR: #880000">UpdateScreenCenterOfRotation</span>(<span style="COLOR: blue">vtkRenderer</span> *<span style="COLOR: navy">ren</span>)
{
<span style="COLOR: blue">double</span> *<span style="COLOR: navy">pt</span>;
<span style="COLOR: green">// save the center of rotation in screen coordinates</span>
<span style="COLOR: navy">ren</span>-><span style="COLOR: #880000">SetWorldPoint</span>(<span style="COLOR: navy">m_center</span>[0], <span style="COLOR: navy">m_center</span>[1], <span style="COLOR: navy">m_center</span>[2], 1.0);
<span style="COLOR: navy">ren</span>-><span style="COLOR: #880000">WorldToDisplay</span>();
<span style="COLOR: navy">pt</span>= <span style="COLOR: navy">ren</span>-><span style="COLOR: #880000">GetDisplayPoint</span>();
<span style="COLOR: navy">m_display_center</span>[0]= <span style="COLOR: navy">pt</span>[0];
<span style="COLOR: navy">m_display_center</span>[1]= <span style="COLOR: navy">pt</span>[1];
}
<span style="COLOR: blue">private</span>:
<span style="COLOR: blue">double</span> <span style="COLOR: navy">m_center</span>[3], <span style="COLOR: green">// In model coordinates.</span>
<span style="COLOR: navy">m_display_center</span>[2]; <span style="COLOR: green">// In display coordinates.</span>
};
<span style="COLOR: #a000a0">vtkStandardNewMacro</span>(<span style="COLOR: blue">InteractorStyleTrackballCamera</span>);
</pre>
<br>
<br>
<div class="moz-cite-prefix">On 8/13/2013 8:59 AM, Serge Lalonde
wrote:<br>
</div>
<blockquote cite="mid:520A2DB1.2090309@infolytica.com"
type="cite">I've gotten no replies to this question. Does that
mean that no one else has had this problem?<br>
<br>
Can someone please confirm that they're using panning with
vtkInteractorStyleTrackballCamera without any problems in
5.10?<br>
<br>
Thanks.<br>
<br>
<div class="moz-cite-prefix">On 8/6/2013 10:49 AM, Serge
Lalonde wrote:<br>
</div>
<blockquote cite="mid:52010CDD.7000607@infolytica.com"
type="cite">I tried panning in ParaView and the clipping
works properly. Is it using the
vtkInteractorStyleTrackballCamera or something else?<br>
<br>
The problem is that it looks like the rotation center is
wrong after panning, causing the model to be rotated out of
the clipping range. It looks like the rotation center is the
center of the window instead of the center of the model.
Also, I have multiple actors in the scene. Could that be a
problem?<br>
<br>
I'm not doing anything (that I can tell) to affect this.
Could it be a bug in VTK 5.10? If so, does anyone know of a
workaround?<br>
<br>
Thanks!<br>
<br>
<div class="moz-cite-prefix">On 8/2/2013 3:59 PM, Serge
Lalonde wrote:<br>
</div>
<blockquote cite="mid:51FC0FB4.50209@infolytica.com"
type="cite">I notice that when using the
vtkInteractorStyleTrackballCamera panning, I'll
subsequently see a clipping problem if I rotate the actors
afterwards.<br>
Calling ResetCameraClippingRange() on the renderer has no
effect. I'm using VTK 5.10.<br>
<br>
Is there a workaround for this? It seems like a pretty
serious problem. I searched the archives without much
success for a fix for this.<br>
<br>
Note: Back in October 2008 (5 years already!), when I was
prototyping with VTK, I posted a fix to vtkusers and <a
class="moz-txt-link-abbreviated"
href="http://www.vtk.org/bug" moz-do-not-send="true">www.vtk.org/bug</a>
for vtkRenderer and vtkCamera that fixed a similar
clipping problem in VTK 5.2. After examining the 5.10
source code, it looks like the fix was never integrated
into VTK's official code branch. The page is <a
class="moz-txt-link-freetext"
href="http://www.vtk.org/Bug/view.php?id=7823"
moz-do-not-send="true">http://www.vtk.org/Bug/view.php?id=7823</a>
and I noticed that its status is expired. Other users
commented in that bug report that it fixed their problems
and some even improved the fix. <br>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<a href="http:://www.infolytica.com"
moz-do-not-send="true">www.infolytica.com </a><br>
300 Leo Pariseau, Suite 2222, Montreal, QC, Canada, H2X
4B3<br>
(514) 849-8752 x236, Fax: (514) 849-4239 </div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com" moz-do-not-send="true">www.kitware.com</a>
Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html" moz-do-not-send="true">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the VTK FAQ at: <a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ" moz-do-not-send="true">http://www.vtk.org/Wiki/VTK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.vtk.org/mailman/listinfo/vtkusers" moz-do-not-send="true">http://www.vtk.org/mailman/listinfo/vtkusers</a>
</pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<a href="http:://www.infolytica.com" moz-do-not-send="true">www.infolytica.com
</a><br>
300 Leo Pariseau, Suite 2222, Montreal, QC, Canada, H2X 4B3<br>
(514) 849-8752 x236, Fax: (514) 849-4239 </div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Powered by <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the VTK FAQ at: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a>
</pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<a moz-do-not-send="true" href="http:://www.infolytica.com">www.infolytica.com
</a><br>
300 Leo Pariseau, Suite 2222, Montreal, QC, Canada, H2X 4B3<br>
(514) 849-8752 x236, Fax: (514) 849-4239 </div>
<p> </p>
<hr> _______________________________________________<br>
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at:
<a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a class="moz-txt-link-freetext" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the VTK FAQ at: <a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a>
</pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<title>Signature</title>
<a href="http:://www.infolytica.com">www.infolytica.com </a><br>
300 Leo Pariseau, Suite 2222, Montreal, QC, Canada, H2X 4B3<br>
(514) 849-8752 x236, Fax: (514) 849-4239
</div>
</body>
</html>