Hi David,<br><br>Thank you so much for your reply.<br><br>You said transform the actor. I guess that's the way I am using. I used vtkActor::SetUserTransform() to pass my transformation to the actor. After that, I think the actor should be moved to another position on the screen. But in this way, the coordinates of points on my actor don't change.<br>
<br>Then I tried vtkCamera::SetUserTransform(). The actor disappeared after translation. I tested the coordinates and found the coordingates changed to very large value, e+64. And I think that explains why the actor disappears.<br>
<br>Here is the code clip I wrote<br><br>//--------------------------------------------------------<br><b>transform->Scale(0.8, 0.8, 0.8);<br>transform->RotateZ(33.5);<br>transform->Translate(translation_vector[0]*0.8, translation_vector[1]*0.8, 0);<br>
<br>camera->SetUserTransform(transform); //I pass the transformation to camera because the point coordinates don't change if I pass it to actor<br>renderer->SetActiveCamera(camera);<br>renWindow->Render();<br>
//---------------------------------------------------------<br></b><br>Actually, I even tried to set the translation parameters manually. For example, the starting point is (204, 367, 0) (Display coordinates), and I set the transformation like transform->Translate(20, 20, 0). The result point from the clip above is (4386, 4902, 0) (Display coordinates);<br>
<br>I think there must be something I missed during the transformation. Could it because the PreMultiply or PostMultiply?<br><br>Thank you very much for your help.<br><br>Long<br><br><div class="gmail_quote">2011/10/29 David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="gmail_quote"><div><div></div><div class="h5">On Sat, Oct 29, 2011 at 5:24 AM, Wenlong Wang <span dir="ltr"><<a href="mailto:scc.wwl@gmail.com" target="_blank">scc.wwl@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Dear all,<br><br>I'm trying to translate my actor (a polydata mesh) with
vtkTransform and vtkTransformFilter. What I want to do is translate my
actor and get the difference of display coordinates of some specific
points.<br>
<br>My current method is like follows<br><b style="color: rgb(51, 51, 255);"><br>//-----------Translation finished above----------------------<br>for (int i = 0; i< 14; i++)<br> {<br> points->GetPoint(landmarks[i], newcoord[i]);<br>
ren->SetWorldPoint(newcoord[i]);<br> ren->WorldToDisplay();<br> ren->GetDisplayPoint(newcoord[i]);<br> }<br>//-----------------------------------------------------------------------</b><br>
<br><font color="#000000">However, the display coordinates after the translation are the same as before translation. </font>And as I tested, the actor position and camera position were not changed
after the translation. Even the actor did move to another position on
the screen.<br><font color="#000000"><br>Is there any other method to achieve it?<br><br>Thank you very much for your kindly help.<br><br>
Best wishes<br>Long<br></font></blockquote><div><br></div></div></div><div>Why don't you just transform the actor instead of the data?</div><div><br></div><div>Take a look at these: </div><div><br></div><a href="https://docs.google.com/present/edit?id=0AcyIfGqnlfSoZGdqaGhnMnJfMjY1aGJqZGZ4ZnQ&hl=en" target="_blank">https://docs.google.com/present/edit?id=0AcyIfGqnlfSoZGdqaGhnMnJfMjY1aGJqZGZ4ZnQ&hl=en</a><br clear="all">
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/TransformActor" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/TransformActor</a></div><div class="gmail_quote"><br><font color="#888888"><div>
David </div></font></div><br>
</blockquote></div><br>