diff --git a/vcg/math/shot.h b/vcg/math/shot.h index 116141f2..053488f0 100644 --- a/vcg/math/shot.h +++ b/vcg/math/shot.h @@ -23,6 +23,9 @@ /**************************************************************************** History $Log: not supported by cvs2svn $ +Revision 1.9 2004/12/15 18:45:50 tommyfranken +*** empty log message *** + Revision 1.4 2004/10/07 14:41:31 fasano Little fix on ViewPoint() method @@ -162,16 +165,21 @@ void Shot::LookTowards(const vcg::Point3 & z_dir,const vcg::Point3 & up template vcg::Point3 Shot::ConvertToCameraCoordinates(const vcg::Point3 & p) const{ - vcg::Point3 cp = similarity.Matrix()*p; + Matrix44 rotM; + similarity.rot.ToMatrix(rotM); + vcg::Point3 cp = rotM * (p+similarity.tra); // note: the camera reference system is right handed cp[2]=-cp[2]; return cp; } template vcg::Point3 Shot::ConvertToWorldCoordinates(const vcg::Point3 & p) const{ - vcg::Point3 cp = Inverse(similarity.Matrix())*p; + Matrix44 rotM; + vcg::Point3 cp = p; // note: the World reference system is left handed cp[2]=-cp[2]; + similarity.rot.ToMatrix(rotM); + cp = Inverse(rotM) * cp-similarity.tra; return cp; } template