Hi,<br><br>I had posted a problem a few days back that I am still having with using vtkActor->SetOrigin(). The documentation of vtkProp3D says that SetOrigin(pos) function sets the point of rotation to the point specified by pos. However, when I apply SetOrigin(pos), my actor moves in the scene such that his point is at the world origin. For example, if I do SetOrigin(100, 100, 100), the actor moves such that the previous (100,100,100) is now at (0,0,0) initially before I apply any other transform to it. The effect is similar to when I do<br>
<br>m_transform->Translate( -100,-100,-100 );<br>m_actor->SetUserTransform( m_transform );<br><br><br>Is this what is expected? Becase from the documentation, I understood that it should do translate(-newOrigin) [rotations, scaling etc] translate(newOrigin). Should I expect that when I do vtkActor->SetOrigin(newOrigin), the newOrigin moves to the world (0,0,0). Can someone explain this to me?<br>
<br>Thank you.<br>Anant.<br><br><br><div class="gmail_quote">On Mon, May 24, 2010 at 11:27 PM, Anant Vemuri <span dir="ltr"><<a href="mailto:ajar108@gmail.com">ajar108@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;">
Thanks... But doesn't SetUserTransform() do that already... the vtk<br>
documentation says as below...<br>
<br>
I think I understand the problem, but not sure how to correct it... I<br>
am attaching a transform as the base transform which means that all<br>
the other operations such as SetOrigin(), SetScale() get overridden.<br>
<div><div></div><div class="h5"><br>
<br>
On 5/24/10, 王君臣 <<a href="mailto:wangjunchen@gmail.com">wangjunchen@gmail.com</a>> wrote:<br>
> what you need is a multiplication (PostMultiply) of m_defaultTrf to the<br>
> current actor transform not a replacement.<br>
><br>
><br>
> 2010/5/24 Anant Vemuri <<a href="mailto:ajar108@gmail.com">ajar108@gmail.com</a>><br>
><br>
>> Hi,<br>
>><br>
>> I am trying to use myVtkActor->SetOrigin(origin) to set the origin so that<br>
>> any rotations I apply is done about this point. This is what I do to build<br>
>> the pipeline<br>
>><br>
>><br>
>> void buildPipeline( )<br>
>> {<br>
>> m_actor->SetMapper( m_mapper );<br>
>> m_actor->SetOrigin( 100, 100, 100 );<br>
>> m_defaultTrf->Scale(m_scale, m_scale, m_scale);<br>
>> m_defaultTrf->PostMultiply();<br>
>> m_defaultTrf->Concatenate( this->getTransform() );<br>
>> /// I add some more things to the m_defaultTrf<br>
>> .<br>
>> .<br>
>> .<br>
>> m_actor->SetUserTransform( m_defaultTrf );<br>
>> }<br>
>> std::cout << "\n\n\nOrigin = [" << m_actor->GetOrigin()[0] << ", " <<<br>
>> m_actor->GetOrigin()[1] << ", " << m_actor->GetOrigin()[2] << "]\n\n\n";<br>
>> }<br>
>><br>
>> But when I apply the transform in the scene, it is not being about some<br>
>> other point entirely. I noticed that this is the same point when I remove<br>
>> the SetOrigin() line. But in the last line it gives me the origin as the<br>
>> one<br>
>> that I set a few line earlier. I am not able to figure out what is the<br>
>> mistake. Can anyone help me?<br>
>><br>
>> Thank you.<br>
>> Anant.<br>
>><br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Please keep messages on-topic and check the VTK FAQ at:<br>
>> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
>><br>
>><br>
><br>
><br>
> --<br>
><br>
<br>
<br>
</div></div><font color="#888888">--<br>
-----------<br>
Anant S. Vemuri<br>
email: <a href="mailto:ajar108@gmail.com">ajar108@gmail.com</a><br>
</font></blockquote></div><br>