From 59ffba5af3b62c84e11ccfd0896ddbcbec520864 Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 10 Sep 2015 15:08:52 +0000 Subject: [PATCH] corrected bug on normal transformation (Thanks to Marco to spotting it out...) --- vcg/complex/algorithms/update/normal.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vcg/complex/algorithms/update/normal.h b/vcg/complex/algorithms/update/normal.h index fbb02a71..82c7e80f 100644 --- a/vcg/complex/algorithms/update/normal.h +++ b/vcg/complex/algorithms/update/normal.h @@ -352,9 +352,10 @@ static void PerVertexMatrix(ComputeMeshType &m, const Matrix44 &mat, if(remove_scaling){ scale = pow(mat33.Determinant(),(ScalarType)(1.0/3.0)); - mat33[0][0]/=scale; - mat33[1][1]/=scale; - mat33[2][2]/=scale; + Point3f scaleV(scale,scale,scale); + Matrix33 S; + S.SetDiagonal(scaleV.V()); + mat33*=S; } for(VertexIterator vi=m.vert.begin();vi!=m.vert.end();++vi)