<div class="gmail_quote">On Tue, Nov 13, 2012 at 4:24 PM, David Lonie <span dir="ltr">&lt;<a href="mailto:david.lonie@kitware.com" target="_blank">david.lonie@kitware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sorry for the noise -- message got sent too early last time...<br>
<div class="im"><br>
Hi list,<br>
<br>
I&#39;m writing a test for some new functionality that will generate<br>
several vtkImageData instances and render them at different positions.<br>
<br>
I&#39;m setting up a vtkImageSlice like this:<br>
<br>
vtkNew&lt;vtkImageData&gt; image1;<br>
</div>// Generate image...<br>
<div class="im">vtkNew&lt;vtkImageSliceMapper&gt; mapper1;<br>
mapper1-&gt;SetInputData(image1.GetPointer());<br>
vtkNew&lt;vtkImageSlice&gt; actor1;<br>
actor1-&gt;SetMapper(mapper1.GetPointer());<br>
actor1-&gt;SetPosition(10, 10, 10);<br>
<br>
</div>then adding the actor to the renderer as usual. The docs for vtkImageSlice say:<br>
<br>
&quot;Prop3D methods such as SetPosition() and RotateWXYZ() change the<br>
position and orientation of the data with respect to VTK world<br>
coordinates.&quot;<br>
<br>
Trouble is, no matter what I set the position of the actor to, the<br>
image appears in the center of the scene. Is this expected behavior?<br>
Is there a better class to use for this sort of thing?<br>
<br>
Thanks,<br>
<br>
Dave</blockquote><div><br></div>I would imagine a ResetCamera() is getting called somewhere after you add the image (which I believe &quot;looks at&quot; the center of the bounding box of all of the actors in the scene). Try adding something else to the scene (say a sphereSource-&gt;GetOutput()) at (0,0,0) and see if you image is in the correct position relative to that. If so, then we&#39;ll have to figure out how to suppress that ResetCamera() call.<br clear="all">
<br>David<br></div>