diff --git a/vcg/complex/algorithms/autoalign_4pcs.h b/vcg/complex/algorithms/autoalign_4pcs.h index cf7370a5..617a1f58 100644 --- a/vcg/complex/algorithms/autoalign_4pcs.h +++ b/vcg/complex/algorithms/autoalign_4pcs.h @@ -323,10 +323,12 @@ return true; template bool FourPCS::IsTransfCongruent(FourPoints fp, vcg::Matrix44 & mat, float & trerr) { - std::vector > fix; - std::vector > mov; - for(int i = 0 ; i < 4; ++i) mov.push_back(B[i]); - for(int i = 0 ; i < 4; ++i) fix.push_back(fp[i]); + std::vector > fix(4); + std::vector > mov(4); + for(int i = 0 ; i < 4; ++i) { + mov[i]=B[i]; + fix[i]=fp[i]; + } if(fabs( Distance(fix[0],fix[1]) - Distance(mov[0],mov[1]) ) > par.delta) return false; if(fabs( Distance(fix[0],fix[2]) - Distance(mov[0],mov[2]) ) > par.delta) return false;