[vtk-developers] vtkTransform

J.A. Lee jeff at cdnorthamerica.com
Wed Nov 14 11:46:56 EST 2001


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
>
>


-- 
J.A. Lee
Software Engineer
Computational Dynamics North America
3 Schoolhouse Lane
Etna NH, 03750
ph: 603-643-9993 x109, fax: 603-643-9994






More information about the vtk-developers mailing list