From 8cc9a085a75642fc16fbbb972d9814c5026408ab Mon Sep 17 00:00:00 2001 From: ponchio Date: Fri, 22 Feb 2008 17:41:48 +0000 Subject: [PATCH] Changed to reflect quaternion toMatrix inversion. --- vcg/math/shot.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vcg/math/shot.h b/vcg/math/shot.h index 97afd2fb..ef34cc0e 100644 --- a/vcg/math/shot.h +++ b/vcg/math/shot.h @@ -23,6 +23,9 @@ /**************************************************************************** History $Log: not supported by cvs2svn $ +Revision 1.23 2007/02/06 08:54:07 corsini +fix names + Revision 1.22 2007/02/05 14:17:21 corsini add extrinsic parameters accessors @@ -236,6 +239,7 @@ vcg::Point3 Shot::ConvertWorldToCameraCoordinates(const vcg::Point3 & p { Matrix44 rotM; Extrinsics.rot.ToMatrix(rotM); + Invert(rotM); vcg::Point3 cp = rotM * (p + Extrinsics.tra); cp[2]=-cp[2]; // note: camera reference system is right handed return cp; @@ -249,7 +253,7 @@ vcg::Point3 Shot::ConvertCameraToWorldCoordinates(const vcg::Point3 & p vcg::Point3 cp = p; cp[2]=-cp[2]; // note: World reference system is left handed Extrinsics.rot.ToMatrix(rotM); - cp = Inverse(rotM) * cp-Extrinsics.tra; + cp = rotM * cp-Extrinsics.tra; return cp; }