solved one numerical issue in RotationMatrix

This commit is contained in:
nico 2019-05-04 22:28:28 +10:00
parent 67cb231cc3
commit eab154fca5
1 changed files with 8 additions and 1 deletions

View File

@ -518,7 +518,14 @@ Matrix33<S> RotationMatrix(vcg::Point3<S> v0,vcg::Point3<S> v1,bool normalized=t
rotM.SetIdentity(); rotM.SetIdentity();
return rotM; return rotM;
} }
if (dot<(-(S)1+epsilon))
{
rotM.SetZero();
rotM[0][0]=-1;
rotM[1][1]=-1;
rotM[2][2]=-1;
return (rotM);
}
///find the axis of rotation ///find the axis of rotation
CoordType axis; CoordType axis;
axis=v0^v1; axis=v0^v1;