Ignore:
Timestamp:
01/24/07 06:53:09 (17 years ago)
Author:
bittner
Message:

render error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp

    r2049 r2050  
    117117{ 
    118118  Triangle3 &t = object->GetItem(); 
    119    
     119 
    120120  glBegin(GL_TRIANGLES); 
    121121  Vector3 normal = t.GetNormal(); 
     
    130130GlRenderer::RenderIntersectable(Intersectable *object) 
    131131{ 
     132  if (!object) 
     133        return; 
     134   
    132135  if (object->Mailed()) 
    133136        return; 
     137 
    134138  object->Mail(); 
    135139   
     
    13891393void GlRenderer::EvalPvsStat(const SimpleRayContainer &viewPoints) 
    13901394{ 
    1391         ClearErrorBuffer(); 
    1392  
    1393         mPvsStat.Reset(); 
    1394         halton.Reset(); 
    1395  
    1396         SetupProjection(GetWidth(), GetHeight()); 
    1397  
    1398         cout << "mPvsStatFrames=" << mPvsStatFrames << endl; 
    1399  
    1400         SimpleRayContainer::const_iterator sit, sit_end = viewPoints.end(); 
    1401         int i = 0; 
    1402  
    1403         for (sit = viewPoints.begin(); sit != sit_end; ++ sit, ++ i)  
    1404         { 
    1405                 //cout << "view point: " << (*sit) << endl;; 
    1406                 SimpleRay sray = *sit; 
    1407  
    1408                 float err; 
    1409  
    1410                 // set frame id for saving the error buffer 
    1411                 mFrame = i; 
    1412                 mViewPoint = sray.mOrigin; 
    1413                 mViewDirection = sray.mDirection; 
    1414  
    1415                 if (0 && (mPvsErrorBuffer[i].mError == 1.0f)) 
     1395  mPvsStat.Reset(); 
     1396 
     1397  SetupProjection(GetWidth(), GetHeight()); 
     1398   
     1399  cout << "mPvsStatFrames=" << mPvsStatFrames << endl; 
     1400   
     1401  SimpleRayContainer::const_iterator sit, sit_end = viewPoints.end(); 
     1402  int i = 0; 
     1403   
     1404  for (sit = viewPoints.begin(); sit != sit_end; ++ sit, ++ i)  
     1405        { 
     1406           
     1407          //cout << "view point: " << (*sit) << endl;; 
     1408          SimpleRay sray = *sit; 
     1409           
     1410          float err; 
     1411           
     1412          // set frame id for saving the error buffer 
     1413          mFrame = i; 
     1414          mViewPoint = sray.mOrigin; 
     1415          mViewDirection = sray.mDirection; 
     1416           
     1417          if (mPvsErrorBuffer[i].mError > 0.0f)  
    14161418                { 
    1417                         // check if the view point is valid 
    1418                         if (!ValidViewPoint()) 
    1419                         { 
    1420                                 cout << "error: " << " view point invalid" << endl; 
    1421                                 mPvsErrorBuffer[i].mError = -1.0f; 
    1422                         } 
    1423                         else 
    1424                         { 
    1425                                 cout << "view point valid" << endl; 
    1426                         } 
     1419                  int pvsSize; 
     1420                   
     1421                  // compute the pixel error 
     1422                  float error = GetPixelError(pvsSize); 
     1423                   
     1424                  mPvsErrorBuffer[i].mError = error; 
     1425                  mPvsErrorBuffer[i].mPvsSize = pvsSize; 
     1426                   
     1427                  cout << "(" << i << "," << mPvsErrorBuffer[i].mError <<")"; 
    14271428                } 
    1428  
    1429                 if (mPvsErrorBuffer[i].mError > 0.0f)  
     1429           
     1430          err = mPvsErrorBuffer[i].mError; 
     1431           
     1432          if (err >= 0.0f)  
    14301433                { 
    1431                         int pvsSize; 
    1432  
    1433                         // compute the pixel error 
    1434                         float error = GetPixelError(pvsSize); 
    1435  
    1436                         mPvsErrorBuffer[i].mError = error; 
    1437                         mPvsErrorBuffer[i].mPvsSize = pvsSize; 
    1438  
    1439                         cout << "(" << i << "," << mPvsErrorBuffer[i].mError <<")"; 
    1440                 } 
    1441  
    1442                 err = mPvsErrorBuffer[i].mError; 
    1443  
    1444                 if (err >= 0.0f)  
    1445                 { 
    1446                         if (err > mPvsStat.maxError) 
    1447                                 mPvsStat.maxError = err; 
    1448  
    1449                         mPvsStat.sumError += err; 
     1434                  if (err > mPvsStat.maxError) 
     1435                        mPvsStat.maxError = err; 
     1436                   
     1437                  mPvsStat.sumError += err; 
    14501438                        mPvsStat.sumPvsSize += mPvsErrorBuffer[i].mPvsSize; 
    1451  
     1439                         
    14521440                        if (err == 0.0f) 
    1453                                 ++ mPvsStat.errorFreeFrames; 
    1454  
     1441                          ++ mPvsStat.errorFreeFrames; 
     1442                         
    14551443                        ++ mPvsStat.frames; 
    14561444                } 
    14571445        } 
    1458  
    1459         glFinish(); 
    1460         cout << endl << flush; 
     1446   
     1447  glFinish(); 
     1448  cout << endl << flush; 
    14611449} 
    14621450 
Note: See TracChangeset for help on using the changeset viewer.