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; }