diff --git a/vcg/math/matrix33.h b/vcg/math/matrix33.h index 3e2f8b4d..9368a9c1 100644 --- a/vcg/math/matrix33.h +++ b/vcg/math/matrix33.h @@ -518,7 +518,14 @@ Matrix33 RotationMatrix(vcg::Point3 v0,vcg::Point3 v1,bool normalized=t rotM.SetIdentity(); 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 CoordType axis; axis=v0^v1;