[vtkusers] what's the difference between actor 's position and sphere 's center ?

Jana Sefcikova neollie at gmail.com
Mon Jun 4 19:18:24 EDT 2012


Hi Fearhope,
I found material that could be helpfull for you
http://www.vtk.org/Wiki/VTK/Presentations , the presentation
Transformations.
I have one notice concerning attached image, frame actor for unit sphere
(without any transformation) is cube centered at the origin [0,0,0]  with
side length 2 with following bounding box (so it does not have nearest left
corent at the origin )

*  Bounds: *

*    Xmin,Xmax: (1, -1)*

*    Ymin,Ymax: (1, -1)*

*    Zmin,Zmax: (1, -1)*
Jana

On 4 June 2012 18:52, fearhope <fearhope at gmail.com> wrote:

> Hi Jochen and David !
>
> thanks for your kind reply.
>
> I have recently found that sphere uses actor's origin as a coordinates
> frame
> according to many experimentatons. i.e., it moves relatively to the actor's
> origin. actor->SetPotion() means to move actor's origin itself. so, they
> should not be changed at the same time. and because the sphere source is
> changed to polygon data (vertex and edges set), we cannot have original
> vtkSphereSource object from the actor reversely.
> Is this correct ?
>
> - actor's coordinates frame
> http://vtk.1045678.n5.nabble.com/file/n5713569/actor_frame.png
>
> if so.. there must be three options to update sphere's location.
> *1. regenerate new sphere source and mapper, and allocate the new mapper to
> the actor at time t-1.
> 2. when make sphere initially, don't change initial center of sphere.
> instead move the actor using SetPosition(). then, when the sphere needs to
> move, use SetPosition function of the actor.
> ==> in this case, radius cannot be updated.
> 3. when the sphere needs to move, transform the polygon data itself using
> vtkTransformPolyDataFilter.*
>
> Is this also correct ? (sorry for bothering you. I'm trying to write as
> detail as possible for other people)
>
> I have tested 1,2 options. however the problem is speed. while option 1's
> speed is around 0.35 ms, option 2 took around 0.002 ms, almost 10 times
> faster. so, option 2 is better. however, when consider initial intent of
> vtk
> design, option 2 seems not to be a good approach.
>
> so, it seems that option 3 is best solution if it is fast enough (I guess
> it
> must be similar to the option 2).
> therefore, I would like to test option 3 now.
>
> *however, to transform polygon data directly, the parameter for
> SetInputConnection is required (I referred to the source code in the
> presentation file recommended by David).
> Now, how can I get the parameter from actor reversely like
> actor->GetMapper()->GetInput()->???*
>
> =======================
> vtkSmartPointer<vtkTransform> transformation=
> vtkSmartPointer<vtkTransform>::New();
> transformation >Translate(double x, double y, double z);
> transformation ->RotateX(double angle);
> transformation ->Scale(double x, double y, double z);
>
> vtkSmartPointer<vtkTransformPolyDataFilter> transformFilter =
> vtkSmartPointer<vtkTransformPolyDataFilter>::New();
> transformFilter->SetInputConnection(sphereSource->GetOutputPort());
> transformFilter->SetTransform(transformation);
> transformFilter->Update();
> =======================
>
> I think this would be last question..
>
> thanks in advance..
> Kind regards,
> Yeonchool
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/what-s-the-difference-between-actor-s-position-and-sphere-s-center-tp5713553p5713569.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120605/cffc02e3/attachment.htm>


More information about the vtkusers mailing list