Commit 569bf731 authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

ca marcheeeeee cd ..cd ..cd ..

parent d6a8ae63
......@@ -254,26 +254,33 @@ void Approximator_RGBfunctions<PFP>::approximate(Dart d)
assert (-3.15 < alpha1 && alpha1 <= 3.15) ;
assert (-3.15 < alpha2 && alpha2 <= 3.15) ;
MATRIX36 &f1 = this->m_attrV[d] ;
MATRIX36 &f2 = this->m_attrV[dd] ;
// Create and sum quadrics
// std::cout << "angles1 : " << gamma1 << " " << alpha1 << std::endl ;
// std::cout << "angles2 : " << gamma2 << " " << alpha2 << std::endl ;
m_quadricRGBfunctions[d] += QuadricRGBfunctions<REAL>(this->m_attrV[d], gamma1, alpha1) ;
m_quadricRGBfunctions[d] += QuadricRGBfunctions<REAL>(this->m_attrV[dd], gamma2, alpha2) ;
QuadricRGBfunctions<REAL> q(f1, gamma1/*, alpha1*/) ;
m_quadricRGBfunctions[d].zero() ;
m_quadricRGBfunctions[d] += QuadricRGBfunctions<REAL>(this->m_attrV[d], gamma1/*, alpha1*/) ;
m_quadricRGBfunctions[d] += QuadricRGBfunctions<REAL>(this->m_attrV[dd], gamma2/*, alpha2*/) ;
// Compute new function
if (! m_quadricRGBfunctions[d].findOptimizedRGBfunctions(this->m_approx[d])) {
this->m_approx[d] = this->m_attrV[d]; // if fail take first one
}
// if (gamma2 < -3) {
// std::cout << "Approx of : " <<std::endl ;
// std::cout << "Frame1 : " << m_frame[d] << std::endl ;
// std::cout << "Function1 : "<< this->m_attrV[d] << std::endl ;
// std::cout << "Frame2 : " << m_frame[dd] << std::endl ;
// std::cout << "Function2 : "<< this->m_attrV[dd] << std::endl ;
// std::cout << "is " << std::endl ;
// std::cout << "Frame :" << m_approxFrame[d] << std::endl ;
// std::cout << "Function : " << this->m_approx[d] << std::endl << std::endl ;
// }
MATRIX36 &newF = this->m_approx[d] ;
// std::cout << "Approx of : " <<std::endl ;
// std::cout << "Frame1 : " << m_frame[d] << std::endl ;
// std::cout << "Function1 : "<< this->m_attrV[d] << std::endl ;
// std::cout << "gamma1 : " << gamma1 << std::endl ;
// std::cout << "Frame2 : " << m_frame[dd] << std::endl ;
// std::cout << "Function2 : "<< this->m_attrV[dd] << std::endl ;
// std::cout << "gamma2 : " << gamma2 << std::endl ;
// std::cout << "is " << std::endl ;
// std::cout << "Frame :" << m_approxFrame[d] << std::endl ;
// std::cout << "Function : " << this->m_approx[d] << std::endl ;
// std::cout << std::endl ;
}
} //namespace Decimation
......
......@@ -42,7 +42,6 @@ public:
typedef Geom::Matrix<6,6,REAL> MATRIX66;
typedef Geom::Matrix<3,3,REAL> MATRIX33;
typedef Quadric<REAL> QUADRIC;
typedef Geom::Matrix<3,6,REAL> MATRIX36;
private:
......
......@@ -424,6 +424,8 @@ void QuadricRGBfunctions<REAL>::operator *= (const REAL v) {
template <typename REAL>
void QuadricRGBfunctions<REAL>::operator /= (const REAL v) {
if (v==REAL(0))
return ;
for (unsigned i = 0; i < 6; ++i)
for (unsigned j = 0; j < 6; ++j)
A(i,j) /= v;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment