[vtkusers] vtkTransform and SetMatrix() routine doesn't reflect in InternalMultiplyPoint

Greg Pintilie gregvtk at gmail.com
Sun Jan 8 20:38:42 EST 2006


Say I have a vtkMatrix4x4 M, and I want to make a vtkTransform object have
the same transform:

        vtkTransform *tr = vtkTransform::New();
        tr->SetMatrix ( M );

Then I want to use this transform in a vtkBoxWidget:

        boxWidget->SetTransform ( tr );


The thing is, the widget doesn't have the same position and orientation as
my original transform!
Looking at the code, the widget uses the function
tr->InternalTransformPoint, and when I checked it out using the following
code:

        double pi[4] = {1, 1, 1, 1};
        double *po = M->MultiplyDoublePoint ( pi );
        printf ("Pt: %f %f %f %f\n", po[0], po[1], po[2], po[3]);
        tr->InternalTransformPoint ( pi, po );
        printf ("Pt: %f %f %f\n", po[0], po[1], po[2]);

I get the following output:
Pt: 94.408877 -29.992743 2.359148 1.000000
Pt: 1.000000 1.000000 1.000000

So tr and M don't match. How do I make tr match M?

Thanks for any help.

Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060108/0aa70510/attachment.htm>


More information about the vtkusers mailing list