[vtkusers] Display Coordinates Doesn't Change After Translation
Wenlong Wang
scc.wwl at gmail.com
Sat Oct 29 13:47:31 EDT 2011
Hi David,
I tried the example about vtkTransformPolyDataFilter and applied it to my
actor. But seems the coordinates didn't change in the way I discribed in my
earlier mail.
So is that because I didn't use it right? Or I should use other methods to
get access to the new dataset generated by vtkTransformPolyDataFilter?
Thank you very much.
Long
2011/10/29 David Doria <daviddoria at gmail.com>
> On Sat, Oct 29, 2011 at 5:24 AM, Wenlong Wang <scc.wwl at gmail.com> wrote:
>
>> Dear all,
>>
>> 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.
>>
>> My current method is like follows
>> *
>> //-----------Translation finished above----------------------
>> for (int i = 0; i< 14; i++)
>> {
>> points->GetPoint(landmarks[i], newcoord[i]);
>> ren->SetWorldPoint(newcoord[i]);
>> ren->WorldToDisplay();
>> ren->GetDisplayPoint(newcoord[i]);
>> }
>> //-----------------------------------------------------------------------
>> *
>>
>> However, the display coordinates after the translation are the same as
>> before translation. 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.
>>
>> Is there any other method to achieve it?
>>
>> Thank you very much for your kindly help.
>>
>> Best wishes
>> Long
>>
>
> Why don't you just transform the actor instead of the data?
>
> Take a look at these:
>
>
> https://docs.google.com/present/edit?id=0AcyIfGqnlfSoZGdqaGhnMnJfMjY1aGJqZGZ4ZnQ&hl=en
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/TransformActor
>
> David
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111029/011844f1/attachment.htm>
More information about the vtkusers
mailing list