From 89973a1a14ca4fd53b19078a75fd7dce99484fa1 Mon Sep 17 00:00:00 2001 From: ponchio Date: Mon, 14 Jul 2008 13:42:22 +0000 Subject: [PATCH] Extrinsics in Shot use Matrix44 not Quaternion. therefore ToMatrix was correct. Rolling back.... sigh. --- vcg/math/shot.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcg/math/shot.h b/vcg/math/shot.h index d8044bbb..6bb75e09 100644 --- a/vcg/math/shot.h +++ b/vcg/math/shot.h @@ -197,7 +197,7 @@ vcg::Point3 Shot::Axis(const int & i) const { vcg::Matrix44 m; Extrinsics.rot.ToMatrix(m); - vcg::Point3 aa = m.GetColumn3(i); + vcg::Point3 aa = m.GetRow3(i); return aa; } @@ -242,7 +242,6 @@ 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; @@ -256,6 +255,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); + Invert(rotM); cp = rotM * cp-Extrinsics.tra; return cp; }