Ignore:
Timestamp:
05/27/08 21:24:34 (16 years ago)
Author:
mattausch
Message:

dynamic objects problem!!

Location:
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
Files:
2 edited

Legend:

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

    r2710 r2720  
    6363        AxisAlignedBox3 box = leaf->GetBox(); 
    6464 
    65         Vector3 p = box.Center() - pt;; 
     65        Vector3 p = box.Center() - pt; 
    6666 
    6767        // set pivot to ground of object 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp

    r2719 r2720  
    589589 
    590590        //cout << "dynamic objects in pvs " << mDynamicPvsObjects.size() << endl;; 
    591  
     591#if 0 
    592592        for (dit = mDynamicPvsObjects.begin(); dit != dit_end; ++ dit) 
    593593        { 
    594594                _RenderDynamicObject(*dit); 
    595595        } 
    596  
    597         glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); 
     596#endif 
     597        //glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); 
    598598 
    599599        // show placed dynamic objects as wireframe 
     
    789789 
    790790        int pixelCount = query->GetQueryResult(); 
    791         pErrorPixels = ((float)pixelCount) / (GetWidth() * GetHeight()); 
     791        pErrorPixels = (float)pixelCount / (GetWidth() * GetHeight()); 
    792792         
    793793        if (0) cout << "error pixels=" << pixelCount << endl; 
     
    13471347void QtGlRendererWidget::LoadObjects() 
    13481348{ 
     1349        AxisAlignedBox3 sceneBox = mViewCellsManager->GetViewSpaceBox(); 
     1350         
     1351        float x = 1.0f; 
     1352        float y = 20.0f; 
     1353        float z = 80.0f; 
     1354 
     1355        AxisAlignedBox3 box(Vector3(0.5f * x, 0, -0.5f * z), Vector3(-0.5f * x, y, 0.5f * z)); 
     1356 
     1357//      box.Scale(Vector3(0.02f, 0.1f, 0.1f)); 
     1358 
     1359        box.Translate(-box.Min()); 
     1360 
     1361        SceneGraphLeaf *leaf = GetPreprocessor()->GenerateBoxGeometry(box); 
     1362        mPlacer->AddObject(leaf); 
     1363         
    13491364        LoadObject("../data/teapot.bn"); 
    13501365        LoadObject("../data/bunny.bn"); 
     
    16251640} 
    16261641 
    1627 #if 0 
    1628 float QtGlRendererWidget::ComputeRenderCost(ViewCell *vc) 
    1629 { 
    1630         ObjectPvs basePvs; 
    1631          
    1632         basePvs = vc->CopyPvs(); 
    1633         ObjectPvsIterator pit = basePvs.GetIterator(); 
    1634  
    1635         float renderCost = 0; 
    1636  
    1637         //cout << "cost vis: " << mShowDistanceWeightedPvs << " " << " " << mShowDistanceWeightedTriangles << " " << mShowWeightedTriangles << endl; 
    1638          
    1639         // first mark all objects from this pvs 
    1640         while (pit.HasMoreEntries())     
    1641         { 
    1642                 KdIntersectable *kdObj = static_cast<KdIntersectable *>(pit.Next()); 
    1643  
    1644                 if (mShowDistanceWeightedPvs) 
    1645                 { 
    1646                         const AxisAlignedBox3 box = kdObj->GetBox(); 
    1647  
    1648                         const float dist = SqrDistance(vc->GetBox().Center(), box.Center()); 
    1649                         renderCost += 1.0f / dist; 
    1650                 } 
    1651                 else if (mShowDistanceWeightedTriangles) 
    1652                 { 
    1653                         const AxisAlignedBox3 box = kdObj->GetBox(); 
    1654  
    1655                         const float dist = SqrDistance(vc->GetBox().Center(), box.Center()); 
    1656                         renderCost += kdObj->ComputeNumTriangles() / dist; 
    1657                 } 
    1658                 else //if (mShowWeightedTriangles) 
    1659                 { 
    1660                         renderCost += kdObj->ComputeNumTriangles(); 
    1661                 } 
    1662                 //if (pit.Next()->Mail(); 
    1663         } 
    1664  
    1665         return renderCost; 
    1666 } 
    1667 #else 
    16681642 
    16691643float QtGlRendererWidget::ComputeRenderCost(ViewCell *vc) 
     
    16881662#endif 
    16891663} 
    1690 #endif 
    1691  
    16921664 
    16931665 
     
    19461918                if (0 && (i < 20)) 
    19471919                { 
    1948                         cout << "pvs1: " << vc->GetPvs().GetSize() << " pvs2: " << compareInfo[i].mPvsSize << " importance: " << importance << endl; 
     1920                        cout << "pvs1: " << vc->GetPvs().GetSize() << " pvs2: "  
     1921                                 << compareInfo[i].mPvsSize << " importance: " << importance << endl; 
    19491922                } 
    19501923 
Note: See TracChangeset for help on using the changeset viewer.