[vtk-developers] vtkTransform

David Gobbi dgobbi at irus.rri.ca
Wed Nov 14 13:15:59 EST 2001


Yes, this looks correct.  Any of the three columns can be flipped,
and the z is the best choice.  The original (incorrect) code was mine, I
think.

 - David

On Wed, 14 Nov 2001, J.A. Lee wrote:

> I hate global-scope loop vars. I think it should be
>
>   if (vtkMath::Determinant3x3(ortho) < 0)
>     {
>     ortho[0][2] = -ortho[0][2];
>     ortho[1][2]= -ortho[1][2];
>     ortho[2][2] = -ortho[2][2];
>     }
>
> which essentially flips the sign of the determinant
>
>
> -Jeff
>
> Ken Martin wrote:
>
> >I found some code in VTK Transform that looks like a bug in the
> >GetOrientation method. It looks like if the if statement were ever
> >ture it would try to access ortho[2][3] which is not correct. Any
> >ideas ?
> >
> >  double ortho[3][3];
> >
> >  for (i = 0; i < 3; i++)
> >    {
> >    ortho[0][i] = matrix[0][i];
> >    ortho[1][i] = matrix[1][i];
> >    ortho[2][i] = matrix[2][i];
> >    }
> >  if (vtkMath::Determinant3x3(ortho) < 0)
> >    {
> >    ortho[0][i] = -ortho[0][i];
> >    ortho[1][i] = -ortho[1][i];
> >    ortho[2][i] = -ortho[2][i];
> >    }
> >
> >--------------------------
> >Ken Martin, PhD
> >Kitware Inc.
> >518 371-3971 x101
> >469 Clifton Corporate Pkwy.
> >Clifton Park, NY 12065
> >
> >_______________________________________________
> >vtk-developers mailing list
> >vtk-developers at public.kitware.com
> >http://public.kitware.com/mailman/listinfo/vtk-developers
> >
> >
>
>
>




More information about the vtk-developers mailing list