From e4c62fec6da98fc6f0379942f64197bd0d57dffa Mon Sep 17 00:00:00 2001 From: ponchio Date: Thu, 21 Feb 2008 11:34:08 +0000 Subject: [PATCH] refixed bug in FromMatrix --- vcg/math/similarity.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/vcg/math/similarity.h b/vcg/math/similarity.h index 7366b29c..c1734fd9 100644 --- a/vcg/math/similarity.h +++ b/vcg/math/similarity.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.14 2008/02/21 10:57:59 ponchio +fixed bug in FromMatrix + Revision 1.13 2008/02/21 10:30:18 benedetti corrected bug in FromMatrix @@ -48,6 +51,9 @@ unified to the gl stlyle matix*vector. removed vector*matrix operator Revision 1.6 2004/03/25 14:57:49 ponchio Microerror. ($LOG$ -> $Log: not supported by cvs2svn $ +Microerror. ($LOG$ -> Revision 1.14 2008/02/21 10:57:59 ponchio +Microerror. ($LOG$ -> fixed bug in FromMatrix +Microerror. ($LOG$ -> Microerror. ($LOG$ -> Revision 1.13 2008/02/21 10:30:18 benedetti Microerror. ($LOG$ -> corrected bug in FromMatrix Microerror. ($LOG$ -> @@ -182,9 +188,9 @@ template Matrix44 Similarity::In template void Similarity::FromMatrix(const Matrix44 &m) { - tra[0] = m.ElementAt(3, 0); - tra[1] = m.ElementAt(3, 1); - tra[2] = m.ElementAt(3, 2); + tra[0] = m.ElementAt(0, 3); + tra[1] = m.ElementAt(1, 3); + tra[2] = m.ElementAt(2, 3); sca = (S)pow(m.Determinant(), 1/3); assert(sca != 0); Matrix44 t = m * Matrix44().SetScale(1/sca, 1/sca, 1/sca);