corrected bug on normal transformation (Thanks to Marco to spotting it out...)

This commit is contained in:
Paolo Cignoni 2015-09-10 15:08:52 +00:00
parent 5b34b5c8e6
commit 59ffba5af3
1 changed files with 4 additions and 3 deletions

View File

@ -352,9 +352,10 @@ static void PerVertexMatrix(ComputeMeshType &m, const Matrix44<ScalarType> &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<ScalarType> S;
S.SetDiagonal(scaleV.V());
mat33*=S;
}
for(VertexIterator vi=m.vert.begin();vi!=m.vert.end();++vi)