<div class="gmail_quote">On Tue, Nov 13, 2012 at 4:24 PM, David Lonie <span dir="ltr"><<a href="mailto:david.lonie@kitware.com" target="_blank">david.lonie@kitware.com</a>></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'm writing a test for some new functionality that will generate<br>
several vtkImageData instances and render them at different positions.<br>
<br>
I'm setting up a vtkImageSlice like this:<br>
<br>
vtkNew<vtkImageData> image1;<br>
</div>// Generate image...<br>
<div class="im">vtkNew<vtkImageSliceMapper> mapper1;<br>
mapper1->SetInputData(image1.GetPointer());<br>
vtkNew<vtkImageSlice> actor1;<br>
actor1->SetMapper(mapper1.GetPointer());<br>
actor1->SetPosition(10, 10, 10);<br>
<br>
</div>then adding the actor to the renderer as usual. The docs for vtkImageSlice say:<br>
<br>
"Prop3D methods such as SetPosition() and RotateWXYZ() change the<br>
position and orientation of the data with respect to VTK world<br>
coordinates."<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 "looks at" the center of the bounding box of all of the actors in the scene). Try adding something else to the scene (say a sphereSource->GetOutput()) at (0,0,0) and see if you image is in the correct position relative to that. If so, then we'll have to figure out how to suppress that ResetCamera() call.<br clear="all">
<br>David<br></div>