From: Eduardo DAVILA Date: Mon, 4 Apr 2022 12:43:57 +0000 (+0200) Subject: #3486 box vtkTransform nomalize the input vector X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=71910b305dd5400b76c32efd40b367390b8a7a93;p=bbtk.git #3486 box vtkTransform nomalize the input vector --- diff --git a/packages/vtk/src/bbvtkTransform.cxx b/packages/vtk/src/bbvtkTransform.cxx index c935a0d..b817609 100644 --- a/packages/vtk/src/bbvtkTransform.cxx +++ b/packages/vtk/src/bbvtkTransform.cxx @@ -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 );