[vtkusers] vtkTransform problem

David Gobbi david.gobbi at gmail.com
Sat Feb 6 11:56:40 EST 2010


Hi Michele,

Inverting a matrix is not a lossless operation.  There is roundoff
error in virtually all floating point computations.

To avoid roundoff error, you should get a copy of the inverted
transform instead of inverting the transform in-place.

vtkTransform *invertedTransform = transform->GetInverse();

That way, you still have the original transform instead of an
"inverted and re-inverted" transform.

   David


On Sat, Feb 6, 2010 at 9:36 AM, Michele Conconi
<michele.conconi at unibo.it> wrote:
> Hi everybody.
> I'm using vtkTransform and its method Inverse() very extensivly in my
> program. After a big number of calls of this method anyway I cannot control
> anymore nor the matrix of vtkTransform neither the position of the
> associated polydata.
> The following code gives an example of my problem.
>
> I read a simple .stl file, bring the associated polydata into a control
> configuration by means of my vtkTransform and here I look at the
> transformation and at the center of the box containing the polydata.
> Then I move the polydata into a different configuration, I invert the
> transformation 10 000 000 times and bring the polydata back into the control
> configuration. After 214 cicle of this loop, the center of my polydata is no
> longer equal to that of the control configuration, and neither it is the
> transformation.
>
> Any clue? I'm getting mad about it!
> Thanks in advance
>
> Michele



More information about the vtkusers mailing list