[vtkusers] multiple transforms

David Doria daviddoria+vtk at gmail.com
Tue Mar 2 08:24:10 EST 2010


On Tue, Mar 2, 2010 at 8:06 AM, Giancarlo Amati
<ilferraresebono at hotmail.it>wrote:

>  Hello vtkurs
>
> this is my question:
>
> let say that i have a sequence of transformation matrices 4x4, let's say A,
> B, C. And I have an actor.
> I use the SetUserTransform in this way:
>
> act->SetUserTransform(A);
> act->SetUserTransform(B);
> act->SetUserTransform(C);
>
> now, my questions are:
>
> 1) the resulting position of the actor is it resulting from the multiply of
> A * B * C?
> 2) the position of the actor is it the last applied?
> 3) if I want to retrieve the connected dataset, is it a transformed dataset
> or the original one?
>
>
> Many thanks!
> Giancarlo
>
>
Hi Giancarlo,

It is possible to answer some of these things by looking at the source code.
I will describe the process below:

1)

By going to the list of classes:
http://www.vtk.org/doc/nightly/html/classes.html
then clicking on vtkActor:
http://www.vtk.org/doc/nightly/html/classvtkActor.html
I noticed that there is no SetUserTransform listed as a function. Therefore,
it must be a function of a super class. To see ALL functions that can be
called on a vtkActor, you can click "List of all members" (half way down the
page).

The SetUserTransform function is then found, and it belongs to vtkProp3D. I
opened Rendering/vtkProp3D.cxx and found SetUserTransform. It looks like it
doesn't do any multiplying, rather, it simply sets the current transform to
the transform that you pass it.

2) Yes, The position of the actor should be the position it is currently in.

3) When you retrieve the connected data set, it is NOT transformed (it is
indeed the original). This is the process when you transform the actor. If
you want to transform the actual data set, you should use
vtkTransformFilter.

Hope that helps,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100302/6b2a14be/attachment.htm>


More information about the vtkusers mailing list