]> Creatis software - bbtk.git/commitdiff
#3486 box vtkTransform nomalize the input vector
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 4 Apr 2022 12:43:57 +0000 (14:43 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 4 Apr 2022 12:43:57 +0000 (14:43 +0200)
packages/vtk/src/bbvtkTransform.cxx

index c935a0dd9b1aa6f3860e3066252f8bc7b098f9d2..b817609f88c853ce6c170a1b2f758da8810508fe 100644 (file)
@@ -117,6 +117,11 @@ namespace bbvtk
           v2[0]             = bbGetInputRotateToNormal()[0];
           v2[1]             = bbGetInputRotateToNormal()[1];
           v2[2]             = bbGetInputRotateToNormal()[2];
+          
+          double mag= sqrt( v2[0]*v2[0] + v2[1]*v2[1]+ v2[2]*v2[2] ) ;
+                 v2[0] = v2[0] / mag;
+                 v2[1] = v2[1] / mag;
+                 v2[2] = v2[2] / mag;
           vtkMath *vtkmath  = vtkMath::New();
           double ang        = acos ( vtkmath->Dot(v1,v2)  );
           ang               = vtkmath->DegreesFromRadians( ang );