add further test about vcg::Shot::ApplySimilarity

This commit is contained in:
Massimiliano Corsini 2011-05-25 06:55:54 +00:00
parent 2a450c7c46
commit d6400c816c
1 changed files with 12 additions and 10 deletions

View File

@ -251,6 +251,7 @@ bool test7(vcg::Shotd shot1, vcg::Point3d p1, vcg::Point3d p2)
if (dist2(p1proj, ptproj) > precision) if (dist2(p1proj, ptproj) > precision)
return false; return false;
// restore the original reference frame to test another transformation
shot1.Extrinsics.SetTra(Torig); shot1.Extrinsics.SetTra(Torig);
shot1.Extrinsics.SetRot(Rorig); shot1.Extrinsics.SetRot(Rorig);
@ -269,6 +270,7 @@ bool test7(vcg::Shotd shot1, vcg::Point3d p1, vcg::Point3d p2)
if (dist2(p1proj, prproj) > precision) if (dist2(p1proj, prproj) > precision)
return false; return false;
// restore the original reference frame to test another transformation
shot1.Extrinsics.SetTra(Torig); shot1.Extrinsics.SetTra(Torig);
shot1.Extrinsics.SetRot(Rorig); shot1.Extrinsics.SetRot(Rorig);
@ -396,21 +398,21 @@ bool test10(vcg::Shotd shot1, vcg::Shotd shot2, vcg::Point3d p1, vcg::Point3d p2
if (dist2(p1proj, psimproj) > precision) if (dist2(p1proj, psimproj) > precision)
return false; return false;
// restore the original reference frame to test another transformation
shot1.Extrinsics.SetTra(Torig); shot1.Extrinsics.SetTra(Torig);
shot1.Extrinsics.SetRot(Rorig); shot1.Extrinsics.SetRot(Rorig);
// WORK IN PROGRESS.. vcg::Similarityd sm;
// double pihalf = 3.1415926535897932384626433832795 / 2.0;
// vcg::Similarityd sm; sm.SetRotate(pihalf, vcg::Point3d(0.0,1.0,0.0));
// sm.SetScale(scale); sm.sca = scale;
// sm.SetTranslate(tr); sm.tra = tr;
// sm.SetRotate(90.0, vcg::Point3d(0.0,1.0,0.0));
// shot1.ApplySimilarity(sm); shot1.ApplySimilarity(sm);
// psimproj = shot1.Project(psim); psimproj = shot1.Project(psim);
// if (dist2(p1proj, psimproj) > precision) if (dist2(p1proj, psimproj) > precision)
// return false; return false;
return true; return true;
} }