Changeset 2709


Ignore:
Timestamp:
05/26/08 01:05:56 (16 years ago)
Author:
mattausch
Message:

sheduling dynamic object only when necessary

Location:
GTP/trunk/Lib/Vis/Preprocessing
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_vienna

    r2706 r2709  
    55 
    66#COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+" 
    7 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish- -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_evaluation=5000000 -samples_per_pass=500000 -total_samples=100000000 -view_cells_import_random_viewcells+" 
     7COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish- -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_evaluation=5000000 -samples_per_pass=500000 -total_samples=300000000 -view_cells_import_random_viewcells+" 
    88 
    99 
    1010#SCENE=../data/vienna/vienna_cropped.obj 
    1111#SCENE=../data/vienna/city_full.obj 
    12 #SCENE=../data/vienna/city_full_hp.obj 
    13 SCENE=../data/vienna/vienna_rep.obj 
     12SCENE=../data/vienna/city_full_hp.obj 
     13#SCENE=../data/vienna/vienna_rep.obj 
    1414 
    1515VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 
     
    3131#DISTRIBUTIONS=spatial 
    3232 
    33 $COMMAND -preprocessor=combined \ 
     33# $COMMAND -preprocessor=combined \ 
     34# -scene_filename=$SCENE \ 
     35# -view_cells_filename=$VIEWCELLS \ 
     36# -rss_distributions=$DISTRIBUTIONS \ 
     37# -view_cells_use_kd_pvs+ -af_use_kd_pvs+ \ 
     38# -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4a.xml \ 
     39# -preprocessor_stats=$PREFIX-i-mixed-b1-n4a.log \ 
     40# -preprocessor_detect_empty_viewspace+ \ 
     41# -preprocessor_use_vbos- \ 
     42# -preprocessor_ray_cast_method=1 \ 
     43# -view_cells_random_viewpoint_list=$VIEWPOINTS \ 
     44# demo1.env 
     45 
     46$COMMAND -preprocessor=sampling \ 
    3447-scene_filename=$SCENE \ 
    3548-view_cells_filename=$VIEWCELLS \ 
    36 -rss_distributions=$DISTRIBUTIONS \ 
    3749-view_cells_use_kd_pvs+ -af_use_kd_pvs+ \ 
    3850-preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4a.xml \ 
     
    4052-preprocessor_detect_empty_viewspace+ \ 
    4153-preprocessor_use_vbos- \ 
    42 -preprocessor_ray_cast_method=3 \ 
     54-preprocessor_ray_cast_method=1 \ 
    4355-view_cells_random_viewpoint_list=$VIEWPOINTS \ 
    4456demo1.env 
    4557 
     58 
     59 
  • GTP/trunk/Lib/Vis/Preprocessing/src/CombinedPreprocessor.cpp

    r2680 r2709  
    1313#include "CombinedPreprocessor.h" 
    1414#include "RayCaster.h" 
    15  
     15#include <windows.h>  
    1616 
    1717 
     
    7979 
    8080  for (mCurrentSamples =0; mCurrentSamples < mTotalSamples; mCurrentSamples += mSamplesPerPass, mPass++) { 
     81          while (mSynchronize) 
     82          { 
     83                  // hack: sleep during walthrough computation 
     84                  Sleep(1000); 
     85          } 
     86 
    8187        mRayCaster->InitPass(); 
    8288         
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp

    r2706 r2709  
    447447 
    448448        glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); 
    449  
    450449        glEnable(GL_NORMALIZE); 
    451  
    452450        glClearColor(0.0f, 0.0f, 0.0f, 1.0f); 
    453451 
     
    916914                { 
    917915                        char filename[256]; 
    918                         sprintf(filename, "snap/frame-%04d-%d.png", mFrame, i); 
     916                        sprintf_s(filename, "snap/frame-%04d-%d.png", mFrame, i); 
    919917                        //                QImage im = toImage(); 
    920918                        //                im.save(filename, "PNG"); 
     
    923921                // evaluate the sample 
    924922                if (useOcclusionQueries)  
    925                 { 
    926923                        EvalQueryWithOcclusionQueries(); 
    927                 } 
    928924                else  
    929                 { 
    930925                        EvalQueryWithItemBuffer(); 
    931                 } 
    932926        }   
    933927 
     
    14521446        for (int i = 0; i < depthMapSize * depthMapSize; ++ i) 
    14531447        { 
    1454                 //todo glGetTexImage() 
     1448                // TODO (use glGetTexImage()) 
    14551449        } 
    14561450} 
     
    15061500                        int pvsSize; 
    15071501 
    1508                         mPvsErrorBuffer[i].mError = GetPixelError(pvsSize); 
     1502                        mPvsErrorBuffer[i].mError = GetPixelError(pvsSize, 0); 
    15091503                        mPvsErrorBuffer[i].mPvsSize = pvsSize; 
    15101504 
     
    15661560{ 
    15671561        mPvsStat.Reset(); 
     1562        ++ mPvsStat.pass; 
    15681563 
    15691564        SetupProjection(GetWidth(), GetHeight()); 
     
    15911586                { 
    15921587                        // compute the pixel error 
    1593                         mPvsErrorBuffer[i].mError = GetPixelError(pvsSize); 
     1588                        mPvsErrorBuffer[i].mError = GetPixelError(pvsSize, mPvsStat.pass); 
    15941589                        mPvsErrorBuffer[i].mPvsSize = pvsSize; 
    15951590 
     
    17001695 
    17011696 
    1702 float GlRenderer::GetPixelError(int &pvsSize) 
     1697float GlRenderer::GetPixelError(int &pvsSize, int pass) 
    17031698{ 
    17041699        return -1.0f; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h

    r2702 r2709  
    4242  int frames; 
    4343  int errorFreeFrames; 
    44  
    45   PvsRenderStatistics() { Reset(); } 
     44  int pass; 
     45 
     46  PvsRenderStatistics(): pass(0) { Reset(); } 
    4647   
    4748  void Reset()  
     
    169170  virtual bool ValidViewPoint(); 
    170171   
    171   virtual float GetPixelError(int &pvsSize); 
     172  /** Gets the pixel error of the current view point.  
     173     returns the size of the pvs for the current view point. pass returns the  
     174         current pass of the evaluation. 
     175         */ 
     176  virtual float GetPixelError(int &pvsSize, int pass); 
    172177   
    173178  virtual void EvalPvsStat(); 
     
    185190  virtual void InitGL(); 
    186191 
    187   virtual int GetWidth() const { return 0; } 
    188   virtual int GetHeight() const { return 0; } 
     192  virtual int GetWidth() const {return 0;} 
     193  virtual int GetHeight() const {return 0;} 
    189194 
    190195  unsigned int GetId(const unsigned char r,  
  • GTP/trunk/Lib/Vis/Preprocessing/src/GtpVisibility05.vcproj

    r2705 r2709  
    898898                                </File> 
    899899                                <File 
     900                                        RelativePath=".\SepPlanesBox3.h" 
     901                                        > 
     902                                </File> 
     903                                <File 
    900904                                        RelativePath=".\SimpleRay.h" 
    901905                                        > 
     
    10811085                                <File 
    10821086                                        RelativePath=".\SceneGraph.cpp" 
     1087                                        > 
     1088                                </File> 
     1089                                <File 
     1090                                        RelativePath=".\SepPlanesBox3.cpp" 
    10831091                                        > 
    10841092                                </File> 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2708 r2709  
    5858mGlobalLinesRenderer(NULL), 
    5959mUseHwGlobalLines(false), 
    60 mTotalRaysCast(0) 
     60mTotalRaysCast(0), 
     61mSynchronize(false) 
    6162{ 
    6263        Environment::GetSingleton()->GetBoolValue("Preprocessor.useGlRenderer", mUseGlRenderer); 
     
    665666                // load scene objects which are the entities used as pvs entries 
    666667                ObjectContainer pvsObjects; 
    667                 if (0) LoadObjects(buf, pvsObjects, mObjects); 
     668                if (1) LoadObjects(buf, pvsObjects, mObjects); 
    668669 
    669670                const bool finalizeViewCells = true; 
     
    746747 
    747748        mViewCellsManager->SetRenderer(mRenderSimulator); 
    748          
    749749        mViewCellsManager->SetPreprocessor(this); 
    750750 
     
    838838         
    839839    Vector3 origin, termination; 
    840         // HACK: needed only for lower_bound algorithm to find the  
    841         // intersected objects 
     840        // HACK: needed only for lower_bound algorithm to find the intersected objects 
    842841        MeshInstance sObj(NULL); 
    843842        MeshInstance tObj(NULL); 
     
    14521451Preprocessor::ComputeRenderError() 
    14531452{ 
    1454   // compute rendering error 
    1455          
     1453  // compute rendering error     
    14561454  if (renderer && renderer->mPvsStatFrames) { 
    14571455         
     
    15961594        mDynamicObjects.push_back(leaf); 
    15971595 
    1598         // add to scene graph 
    1599         mSceneGraph->GetRoot()->mChildren.push_back(leaf); 
    1600  
    1601         if (mRayCaster) 
    1602                 mRayCaster->AddDynamicObjecs(leaf->mGeometry, leaf->GetTransformation()); 
     1596        // tell ray caster to update 
     1597        ScheduleUpdateDynamicObjects(); 
     1598 
     1599        if (0)  
     1600        { 
     1601                // add to scene graph 
     1602                mSceneGraph->GetRoot()->mChildren.push_back(leaf); 
     1603                // add to ray caster 
     1604                if (mRayCaster) 
     1605                        mRayCaster->AddDynamicObjecs(leaf->mGeometry, leaf->GetTransformation()); 
     1606        } 
    16031607        // $$ JB in order to compile 
    16041608        //return leaf; 
     
    16461650 
    16471651                leaf->UpdateBox(); 
     1652 
     1653                float offs = -leaf->GetOriginalBox().Min().y; 
     1654 
     1655                // scale so pivot is always on bottom 
     1656                for (it = leaf->mGeometry.begin(); it != it_end; ++ it) 
     1657                { 
     1658                        TriangleIntersectable *tri = static_cast<TriangleIntersectable *>(*it); 
     1659 
     1660                        Triangle3 t = tri->GetItem(); 
     1661 
     1662                        // hack: scale object appropriately 
     1663                        t.mVertices[0].y += offs; 
     1664                        t.mVertices[1].y += offs; 
     1665                        t.mVertices[2].y += offs; 
     1666 
     1667                        tri->SetItem(t); 
     1668                } 
     1669 
     1670                leaf->UpdateBox(); 
     1671 
     1672 
    16481673                cout<<"Dynamic object loaded successfully: " << leaf->GetBox() << endl; 
    16491674 
     
    17091734 
    17101735 
     1736void Preprocessor::ObjectRemoved(SceneGraphLeaf *leaf) 
     1737{ 
     1738        ObjectMoved(leaf); 
     1739} 
     1740 
     1741 
    17111742void Preprocessor::UpdateDynamicObjects() 
    17121743{ 
     
    17161747                preprocessor->mRayCaster->DeleteDynamicObjects(); 
    17171748         
    1718                 for (size_t i=0; i < mDynamicObjects.size(); ++ i)  
     1749                for (size_t i = 0; i < mDynamicObjects.size(); ++ i)  
    17191750                { 
    17201751                        SceneGraphLeaf *l = mDynamicObjects[i]; 
    1721                    
    1722                         cout<<"Updating dynamic objects in ray caster..."<<endl; 
    1723                    
    1724                         mRayCaster->AddDynamicObjecs(l->mGeometry, l->GetTransformation()); 
    1725                          
    1726                         cout<<"done."<<endl; 
    1727                          
    1728                         cerr<<"Updating affected PVSs..."<<endl; 
    1729                         preprocessor->ObjectMoved(l); 
    1730                         cerr<<"done."<<endl;       
     1752 
     1753                        UpdateObjectInRayCaster(l); 
     1754 
     1755                        if (l->HasChanged()) 
     1756                        { 
     1757                                cout<<"Updating affected PVSs..."<<endl; 
     1758                                preprocessor->ObjectMoved(l); 
     1759                                cout<<"done."<<endl;     
     1760                                l->SetHasChanged(false); 
     1761                        } 
    17311762                } 
    17321763         
    17331764                mUpdateDynamicObjects = false; 
    1734          
    17351765        } 
    17361766} 
     
    17391769void Preprocessor::ScheduleUpdateDynamicObjects() 
    17401770{ 
    1741                 mUpdateDynamicObjects = true; 
    1742 } 
    1743  
    1744  
    1745 } 
     1771        mUpdateDynamicObjects = true; 
     1772} 
     1773 
     1774 
     1775void Preprocessor::UpdateObjectInRayCaster(SceneGraphLeaf *l) 
     1776{ 
     1777        cout<<"Updating dynamic objects in ray caster..."<<endl; 
     1778 
     1779        mRayCaster->AddDynamicObjecs(l->mGeometry, l->GetTransformation()); 
     1780        cout<<"done."<<endl; 
     1781} 
     1782 
     1783} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h

    r2702 r2709  
    200200        void RegisterDynamicObject(SceneGraphLeaf *leaf); 
    201201         
     202        void UpdateObjectInRayCaster(SceneGraphLeaf *l); 
     203         
     204        void ScheduleUpdateDynamicObjects(); 
     205        void UpdateDynamicObjects(); 
     206        /** Notify the preprocessor that an object has been deleted 
     207        */ 
     208        virtual void ObjectRemoved(SceneGraphLeaf *object); 
     209 
    202210 
    203211 
    204212        ///////////////////////// 
     213 
     214        bool mSynchronize; 
    205215 
    206216        /// scene graph loaded from file 
     
    277287        RayCaster *mRayCaster; 
    278288 
    279         int mGenericStats[2]; 
    280  
    281         void ScheduleUpdateDynamicObjects(); 
    282         void UpdateDynamicObjects(); 
    283  
    284         /// triangle pvs for gvs  
     289        // triangle pvs for gvs  
    285290        // hack: should be in gvspreprocessor but pulled  
    286291        // out here for visualization purpose 
    287292        ObjectContainer mTrianglePvs; 
     293 
     294        // generic stats vector that can be used for anything 
     295        int mGenericStats[2]; 
    288296 
    289297        //std::vector<int> mDummyBuffer; 
     
    309317        */ 
    310318        virtual void ObjectMoved(SceneGraphLeaf *object); 
    311  
     319         
    312320 
    313321 
  • GTP/trunk/Lib/Vis/Preprocessing/src/PvsBase.h

    r2707 r2709  
    306306                // the last part should not be more than log of the sorted part. this 
    307307                // way we can achieve logarithmic behaviour for insertion and find 
    308                 const int n = mEntries.size(); 
     308                const int n = (int)mEntries.size(); 
    309309                const int dirtySize = n - mLastSorted; 
    310310 
    311311                const double LOG2E = 1.442695040f; 
    312312 
    313                 const float logN = (float)log((float) Max(1, n))/LOG2E; 
    314                 const float logS = (float)log((float) Max(1, mLastSorted))/LOG2E; 
    315                 const float logD = (float)log((float) Max(1, dirtySize))/LOG2E; 
     313                const float logN = log((float) Max(1, n))/ (float)LOG2E; 
     314                const float logS = log((float) Max(1, mLastSorted))/ (float)LOG2E; 
     315                const float logD = log((float) Max(1, dirtySize))/ (float)LOG2E; 
    316316 
    317317                if (8*(n + 2*dirtySize*logD) < 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp

    r2707 r2709  
    5050QtGlDebuggerWidget *debuggerWidget = NULL; 
    5151 
    52 const static int SAMPLES_INCR = 2000000; 
    5352 
    5453 
    5554static SimpleRayContainer sViewPointsList; 
    5655static SimpleRayContainer::const_iterator sViewPointsListIt; 
    57  
     56static int sCurrentSamples = 0; 
     57static int sNextSamplesThreshold[] = {10000000, 50000000, 100000000, 250000000}; 
     58//static int sNextSamplesThreshold[] = {100000000, 200000000}; 
     59static int sNumReplays = 4; 
     60static int sCurrentSamplesThreshold = 0; 
    5861 
    5962 
     
    125128                                                                           KdTree *tree): 
    126129QGLPixelBuffer(QSize(w, h),  
    127                            QGLFormat(QGL::StencilBuffer |  
     130                           QGLFormat(QGL::SampleBuffers) 
     131                           /*,| 
     132                                                 QGL::StencilBuffer |  
    128133                                                 QGL::DepthBuffer |  
    129134                                                 QGL::DoubleBuffer | 
    130135                                                 QGL::Rgba) 
    131                                                  ), 
     136                                                 */), 
    132137GlRendererBuffer(sceneGraph, viewcells, tree) 
    133138{ 
     
    190195 
    191196// reimplemented here so that we can snap the error windows 
    192 float QtGlRendererBuffer::GetPixelError(int &pvsSize) 
     197float QtGlRendererBuffer::GetPixelError(int &pvsSize, int pass) 
    193198{ 
    194199        MakeLive(); 
     
    237242 
    238243        // use shading 
    239         if (mSnapErrorFrames) 
    240         { 
     244        if (1)//mSnapErrorFrames) 
     245        { 
     246                glEnable(GL_NORMALIZE); 
     247 
     248                // mat_specular and mat_shininess are NOT default values 
     249        GLfloat mat_ambient[] = {0.5f, 0.5f, 0.5f, 1.0f}; 
     250        GLfloat mat_diffuse[] = {1.0f, 1.0f, 1.0f, 1.0f}; 
     251        GLfloat mat_specular[] = {0.3f, 0.3f, 0.3f, 1.0f}; 
     252        GLfloat mat_shininess[] = {1.0f}; 
     253 
     254        glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); 
     255        glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); 
     256        glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); 
     257        glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); 
     258 
    241259                GLfloat light_ambient[] = {0.3, 0.3, 0.3, 1.0}; 
     260                //GLfloat light_diffuse[] = {0.6, 0.6, 0.6, 1.0}; 
    242261                GLfloat light_diffuse[] = {0.6, 0.6, 0.6, 1.0}; 
    243262                GLfloat light_specular[] = {1.0, 1.0, 1.0, 1.0}; 
    244263 
     264                glEnable(GL_LIGHTING); 
    245265                //GLfloat light_position[] =  {278.0f, 548.8f,279.0f, 1.0f}; 
    246                 GLfloat light_position[] =  {0.f,0.f,0.f, 1.0f}; 
     266                //GLfloat light_position[] =  {0.f, 0.f, 0.f, 1.0f}; 
     267                GLfloat light_position[] =  {0.f, 0.0f, 0.f, 1.0f}; 
    247268 
    248269                glEnable(GL_LIGHT0);  
     
    252273                glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); 
    253274                glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); 
    254  
    255                 glEnable(GL_LIGHTING); 
    256275                glLightfv (GL_LIGHT0, GL_POSITION, light_position); 
    257276 
    258277                glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); 
    259                 glEnable(GL_COLOR_MATERIAL); 
     278                //glEnable(GL_COLOR_MATERIAL); 
     279 
     280                GLfloat lmodel_ambient[] = {0.3f, 0.3f, 0.3f, 1.0f}; 
     281                glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); 
    260282 
    261283                glShadeModel(GL_SMOOTH); 
    262284        } 
    263285 
    264         glDisable(GL_ALPHA_TEST); 
     286        //glDisable(GL_ALPHA_TEST); 
    265287                 
    266288        glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    267289        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 
    268290 
    269         //glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_TRUE); 
    270         glColor3f(0, 1, 0); 
     291        glColor3f(0.6f, 0.6f, 0.6f); 
     292        //glColor3f(0, 1, 0); 
    271293 
    272294        glDepthFunc(GL_LESS); 
     
    274296        glEnable(GL_DEPTH_TEST); 
    275297 
     298        glFrontFace(GL_CCW); 
     299        glCullFace(GL_BACK); 
     300 
    276301        glStencilFunc(GL_EQUAL, 0x0, 0x1); 
    277302        glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);  
     
    301326        query->BeginQuery(); 
    302327 
     328        // current frame has to be increased at each rendering pass 
    303329        ++ mCurrentFrame; 
    304330 
     
    317343 
    318344        // some error happened 
    319         if (pixelCount > pixelThres)  
     345        if (1) // pixelCount > pixelThres)  
    320346        { 
    321347                cout << "f " << mFrame << " id " << viewcell->GetId() << " pvs " << pvsSize  
    322348                         << " e " << pixelCount << " vp " << mViewPoint << " vd " << mViewDirection << endl; 
    323349         
     350                format().setSampleBuffers(true); 
     351                cout << "here3 " << format().sampleBuffers() << endl; 
    324352                if (mSnapErrorFrames)  
    325353                { 
     
    327355                        //glReadBuffer(GL_FRONT); 
    328356 
    329  
    330357                        ////////////// 
    331358                        //-- output error visualization 
    332359 
    333360                        char filename[256]; 
    334                         //sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels); 
    335                         sprintf(filename, "error-frame-%04d-%04d-%08d.png", mFrame, viewcell->GetId(), pixelCount); 
     361                        sprintf(filename, "error-frame-%04d-%05d.bmp", pass, mFrame); 
     362                        //sprintf(filename, "error-frame-%05d-%0.5f.png", mFrame, pErrorPixels); 
     363                        //sprintf_s(filename, "error-frame-%05d-%04d-%08d.png", mFrame, viewcell->GetId(), pixelCount); 
     364 
    336365                        QImage im = toImage(); 
    337366                        string str = mSnapPrefix + filename; 
    338367                        QString qstr(str.c_str()); 
    339368 
    340                         im.save(qstr, "PNG"); 
     369                        //im.save(qstr, "PNG"); 
     370                        // use bmp for lossless storage (for video) 
     371                        im.save(qstr, "BMP"); 
    341372 
    342373                        if (0) 
     
    367398 
    368399                                im = toImage(); 
    369                                 sprintf(filename, "error-frame-%04d-%04d-%08d-pvs.png", mFrame, viewcell->GetId(), pixelCount); 
     400                                sprintf_s(filename, "error-frame-%04d-%04d-%08d-pvs.png", mFrame, viewcell->GetId(), pixelCount); 
    370401                                str = mSnapPrefix + filename; 
    371402                                qstr = str.c_str(); 
     
    433464        //glEnable(GL_FOG); 
    434465        //glFogi(GL_FOG_MODE, GL_EXP); 
     466        //glFogf(GL_FOG_DENSITY, .2f); 
    435467        glFogi(GL_FOG_MODE, GL_LINEAR); 
    436  
    437 //      glFogf(GL_FOG_DENSITY, .2f); 
    438468        glFogf(GL_FOG_START, 50.f); 
    439469        glFogf(GL_FOG_END, 500.f); 
    440470 
    441         GLfloat light_ambient[] = {0.3, 0.3, 0.3, 1.0}; 
    442     GLfloat light_diffuse[] = {0.6, 0.6, 0.6, 1.0}; 
    443     GLfloat light_specular[] = {1.0, 1.0, 1.0, 1.0}; 
    444     GLfloat light_position[] =  //{278.0f, 548.8f,279.0f, 1.0f }; 
    445     { 0.f,0.f,0.f,1.0f }; 
    446  
    447     /*glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); 
    448     glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); 
    449     glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); 
    450     glLightfv(GL_LIGHT0, GL_POSITION, light_position); 
    451 */ 
    452     glEnable(GL_LIGHT0);  
    453  
     471         
     472        // mat_specular and mat_shininess are NOT default values 
    454473        GLfloat mat_ambient[] = {0.5f, 0.5f, 0.5f, 1.0f}; 
    455          
    456         // mat_specular and mat_shininess are NOT default values 
    457474        GLfloat mat_diffuse[] = {1.0f, 1.0f, 1.0f, 1.0f}; 
    458475        GLfloat mat_specular[] = {0.3f, 0.3f, 0.3f, 1.0f}; 
    459476        GLfloat mat_shininess[] = {1.0f}; 
    460477 
    461 /*      GLfloat light_ambient[] = {0.2f, 0.2f, 0.2f, 1.0f}; 
    462         GLfloat light_diffuse[] = {0.4f, 0.4f, 0.4f, 1.0f}; 
    463         GLfloat light_specular[] = {0.3f, 0.3f, 0.3f, 1.0f}; 
    464  
    465         GLfloat lmodel_ambient[] = {0.3f, 0.3f, 0.3f, 1.0f}; 
    466 */ 
    467  
    468         // default Material 
    469478        glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); 
    470479        glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); 
     
    472481        glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); 
    473482 
    474         // a light 
     483 
     484        glEnable(GL_LIGHTING); 
     485 
     486        // a light       
     487        GLfloat light_ambient[] = {0.3, 0.3, 0.3, 1.0}; 
     488    GLfloat light_diffuse[] = {0.6, 0.6, 0.6, 1.0}; 
     489    GLfloat light_specular[] = {1.0, 1.0, 1.0, 1.0}; 
     490    GLfloat light_position[] =  {0.f, .0f, 0.f, 1.0f}; 
     491    //GLfloat light_position[] =  {600.0f, 250.0f, -500.f, 1.0f}; 
     492    //GLfloat light_position[] = {278.0f, 548.8f,279.0f, 1.0f}; 
     493 
    475494        glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); 
    476495        glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); 
    477496        glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); 
    478497 
    479         /*glLightfv(GL_LIGHT1, GL_AMBIENT, light_ambient); 
     498        glLightfv(GL_LIGHT0, GL_POSITION, light_position); 
     499 
     500        //glDisable(GL_LIGHT0); 
     501        glEnable(GL_LIGHT0); 
     502 
     503        glLightfv(GL_LIGHT1, GL_AMBIENT, light_ambient); 
    480504        glLightfv(GL_LIGHT1, GL_DIFFUSE, light_diffuse); 
    481505        glLightfv(GL_LIGHT1, GL_SPECULAR, light_specular); 
    482 */ 
    483         //glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); 
    484  
    485         glEnable(GL_LIGHTING); 
    486         glEnable(GL_LIGHT0); 
    487 //      glEnable(GL_LIGHT1); 
    488  
    489         // set position of the light 
    490         /*GLfloat infinite_light[] = {  1.0, 0.8, 1.0, 0.0  }; 
    491         glLightfv (GL_LIGHT0, GL_POSITION, infinite_light); 
    492  
     506                 
    493507        // set position of the light2 
    494508        GLfloat infinite_light2[] = {  -0.3, 1.5, 1.0, 0.0  }; 
    495509        glLightfv (GL_LIGHT1, GL_POSITION, infinite_light2); 
    496 */ 
    497         glLightfv (GL_LIGHT0, GL_POSITION, light_position); 
    498  
    499         glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); 
    500         // glColorMaterial( GL_FRONT_AND_BACK, GL_SPECULAR); 
     510        //glEnable(GL_LIGHT1); 
     511 
     512        GLfloat lmodel_ambient[] = {0.3f, 0.3f, 0.3f, 1.0f}; 
     513        glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); 
     514 
     515        glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); 
     516        //glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR); 
    501517        glEnable(GL_COLOR_MATERIAL); 
    502518 
     
    568584        dit, dit_end = p->mDynamicObjects.end(); 
    569585 
    570         for (dit = p->mDynamicObjects.begin(); dit != dit_end; ++ dit) 
    571         { 
    572                 glColor3f(0, 1, 0); 
     586        int i = 0; 
     587        for (dit = p->mDynamicObjects.begin(); dit != dit_end; ++ dit, ++ i) 
     588        { 
     589                if (i == mCurrentDynamicObjectIdx) 
     590                        glColor3f(1, 0, 1); 
     591                else 
     592                        glColor3f(0, 1, 0); 
     593 
    573594                glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); 
    574595                _RenderDynamicObject(*dit); 
    575596                glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); 
    576597        } 
    577  
    578         //_RenderDynamicObject(mPendingDynamicObject); 
    579598} 
    580599 
     
    692711                        mWireFrame = false; 
    693712                } 
    694                  
    695                 //mCurrentPvsCost = viewcell->GetPvs().EvalPvsCost(); 
    696713        }  
    697714        else  
     
    722739 
    723740        glEnable(GL_STENCIL_TEST);  
    724  
    725741        glDisable(GL_LIGHTING); 
    726742 
     
    770786                        cout << "stopping replay" << endl; 
    771787                        mReplayMode = false; 
     788                        GetPreprocessor()->mSynchronize = false; 
    772789                } 
    773790                else 
     
    781798                } 
    782799 
    783  
    784800                updateGL(); 
    785         } 
    786  
    787         if (timerEvent->timerId() == mUpdateTimerId) 
     801 
     802                // output the current frame buffer 
     803                if (mExportFrameBuffer) 
     804                { 
     805                        const int dist = sViewPointsListIt - sViewPointsList.begin(); 
     806 
     807                        char filename[200]; 
     808                        sprintf(filename, "error-frame-%04d-%05d.bmp", sCurrentSamples, dist); 
     809                        //QPixmap img = renderPixmap(0, 0, true); 
     810                        QImage im = grabFrameBuffer(); 
     811 
     812                        string str = mSnapPrefix + filename; 
     813                        QString qstr(str.c_str()); 
     814 
     815                        //im.save(qstr, "PNG"); 
     816                        // use bmp for lossless storage (for video) 
     817                        im.save(qstr, "BMP"); 
     818                } 
     819        } 
     820        else if (timerEvent->timerId() == mUpdateTimerId) 
     821                // update pvss from time to time 
    788822                update(); 
     823 
     824        // grab frame buffer after a certain number of samples 
     825        if (!mReplayMode &&  
     826                (sCurrentSamplesThreshold < sNumReplays) &&  
     827                ((GetPreprocessor()->mCurrentSamples > sNextSamplesThreshold[sCurrentSamplesThreshold]))) 
     828        { 
     829                ++ sCurrentSamplesThreshold; 
     830                cout << "replaying at total samples: " << GetPreprocessor()->mCurrentSamples << endl; 
     831                ReplayViewPoints(); 
     832        } 
     833 
    789834} 
    790835 
     
    803848                { 
    804849                        Vector3 pt = Unproject(x, y); 
    805                         cout << "unproject: " << pt << endl; 
    806850 
    807851                        mPlacer->PlaceObject(pt); 
     
    813857                        SceneGraphLeaf *newObj = new SceneGraphLeaf(*leaf); 
    814858 
    815                         mViewCellsManager->GetPreprocessor()->RegisterDynamicObject(newObj); 
    816                         //mPendingDynamicObjects.push_back(); 
     859                        // make current object 
     860                        // the object is added at the end of the vector 
     861                        mCurrentDynamicObjectIdx = (int)GetPreprocessor()->mDynamicObjects.size(); 
     862 
     863                        GetPreprocessor()->RegisterDynamicObject(newObj); 
    817864                } 
    818865        } 
     
    828875        mousePoint.y = y; 
    829876 
    830         if (e->modifiers() & Qt::AltModifier)  
     877        if (e->modifiers() & Qt::ShiftModifier)  
    831878        { 
    832879                const Vector3 pt = Unproject(x, y); 
     
    834881                int idx = FindDynamicObject(x, y); 
    835882                 
    836                 Preprocessor *p = GetPreprocessor(); 
    837  
    838                 swap(p->mDynamicObjects[idx], p->mDynamicObjects.back()); 
    839                 p->mDynamicObjects.pop_back(); 
    840                 //preprocessor->ScheduleUpdateDynamicObjects(); 
     883                if (idx >= 0) 
     884                { 
     885                        mCurrentDynamicObjectIdx = idx; 
     886                } 
    841887        } 
    842888} 
     
    865911                mViewPoint.x += (x-mousePoint.x)*MOVE_SENSITIVITY / 2.0; 
    866912        } 
    867 #if 0// DYNAMIC_OBJECTS_HACK 
    868913        else if (e->modifiers() & Qt::AltModifier) 
    869914        { 
     
    896941                        case 2: 
    897942                                { 
    898                                   // tm = RotationXMatrix(diffx) * RotationYMatrix(diffy); 
    899                                   tm = RotationYMatrix(diffx); 
     943                                        // tm = RotationXMatrix(diffx) * RotationYMatrix(diffy); 
     944                                        tm = RotationYMatrix(diffx); 
    900945                                } 
    901946                                break; 
     
    911956                } 
    912957        } 
    913 #endif 
    914958        else 
    915959        { 
     
    10431087                        break; 
    10441088 
    1045                 if (sscanf(text.toAscii(), "%f %f %f", &mViewPoint.x, &mViewPoint.y, &mViewPoint.z) == 3) { 
     1089                if (sscanf_s(text.toAscii(), "%f %f %f", &mViewPoint.x, &mViewPoint.y, &mViewPoint.z) == 3) { 
    10461090                        text.sprintf("%f %f %f", mViewDirection.x, mViewDirection.y, mViewDirection.z); 
    10471091                        text = QInputDialog::getText(this, 
     
    10531097                        if (!ok) 
    10541098                                break; 
    1055                         if (sscanf(text.toAscii(), "%f %f %f", &mViewDirection.x, 
     1099                        if (sscanf_s(text.toAscii(), "%f %f %f", &mViewDirection.x, 
    10561100                                &mViewDirection.y, &mViewDirection.z) == 3) { 
    10571101                                        updateGL(); 
     
    10751119                                                                           QWidget * parent, 
    10761120                                                                           const QGLWidget * shareWidget, 
    1077                                                                            Qt::WFlags f 
    1078                                                                            ) 
    1079                                                                            : 
    1080 GlRendererWidget(sceneGraph, viewcells, tree), QGLWidget(QGLFormat(QGL::SampleBuffers), parent, shareWidget, f) 
     1121                                                                           Qt::WFlags f): 
     1122GlRendererWidget(sceneGraph, viewcells, tree),  
     1123QGLWidget(QGLFormat(QGL::SampleBuffers), parent, shareWidget, f) 
    10811124{ 
    10821125        mPreprocessorThread = NULL; 
     
    11391182        mPlacer = new ObjectPlacer(); 
    11401183 
    1141         //mPendingDynamicObject = NULL; 
     1184        mCurrentDynamicObjectIdx = -1; 
     1185 
     1186        //mExportFrameBuffer = true; 
     1187        mExportFrameBuffer = false; 
    11421188 
    11431189        SetSceneCut(1000); 
     
    12001246        connect(mControlWidget, SIGNAL(SetShowRays(bool)), this, SLOT(SetShowRays(bool))); 
    12011247 
    1202 #if 0 
     1248#if 1 
    12031249        connect(mControlWidget, SIGNAL(SetTranslation(bool)), this, SLOT(SetTranslation(bool))); 
    12041250        connect(mControlWidget, SIGNAL(SetRotation(bool)), this, SLOT(SetRotation(bool))); 
     
    12061252#endif 
    12071253        connect(mControlWidget, SIGNAL(UpdateDynamicObjects()), this, SLOT(UpdateDynamicObjects())); 
     1254        connect(mControlWidget, SIGNAL(DeleteDynamicObject()), this, SLOT(DeleteDynamicObject())); 
    12081255 
    12091256        setWindowTitle("PVS Visualization"); 
    12101257 
    12111258        // setting the main window size here 
    1212         resize(800, 600); 
    1213         //resize(640, 400); 
     1259        //resize(800, 600); 
     1260        resize(640, 480); 
    12141261         
    12151262        mControlWidget->show(); 
     
    14281475                filter = mViewCellsManager->GetMaxFilterSize(); 
    14291476 
    1430         glColor3f(0.0f, 0.0f, 1.0f); 
    1431  
    1432 #if REMOVE_TEMPORARY 
     1477#if 0 //REMOVE_TEMPORARY 
    14331478        s.sprintf("frame:%04d viewpoint:(%4.1f,%4.1f,%4.1f) dir:(%4.1f,%4.1f,%4.1f)", 
    14341479                mFrame, 
     
    14471492                filter, 
    14481493                mPvsSize, 
    1449                 mRenderError*100.0f); 
     1494                mRenderError * 100.0f); 
    14501495 
    14511496        renderText(20, 40, s); 
    14521497#endif 
    14531498 
    1454         QFont font40; font40.setPointSize(30); 
     1499        glDisable(GL_LIGHTING); 
     1500        //qglColor(QColor(0, 255, 0)); 
     1501        glColor3f(0, 1, 0); 
     1502        QFont font40; font40.setPointSize(25); 
    14551503        //s.sprintf("PVS: %04d", mPvsSize); 
    14561504        //renderText(20, 40, s, font40); 
     
    14611509        //renderText(290, 70, s, font40); 
    14621510 
    1463         s.sprintf("PVS TRI: %07d", (int)mCurrentPvsCost); 
    1464         renderText(290, 70, s, font40); 
     1511        s.sprintf("PVS TRI: %08d", (int)mCurrentPvsCost); 
    14651512        //renderText(290, 70, s, font40); 
     1513        renderText(325, 40, s, font40); 
     1514        s.sprintf("error: %3.3f %", mRenderError * 100.0f); 
     1515        renderText(20, 40, s, font40); 
     1516 
     1517        //renderText(290, 70, s, font40); 
     1518        glEnable(GL_LIGHTING); 
    14661519 
    14671520} 
     
    18091862                        importance = rcCost / maxRcCost; 
    18101863                } 
    1811 if (importance > 1.0f) importance = 1.0f; 
     1864                 
     1865                if (importance > 1.0f) importance = 1.0f; 
    18121866                // c = RgbColor(importance, 1.0f - importance, 0.0f); 
    18131867                c = RainbowColorMapping(importance); 
     
    19622016        connect(button, SIGNAL(clicked()), SIGNAL(UpdateDynamicObjects())); 
    19632017         
     2018        button = new QPushButton("Delete", groupBox); 
     2019        vbox2->addWidget(button); 
     2020        connect(button, SIGNAL(clicked()), SIGNAL(DeleteDynamicObject())); 
    19642021         
    19652022        groupBox->setLayout(vbox2); 
     
    25382595        // set up the pbuffer context 
    25392596        mRenderBuffer->makeCurrent(); 
    2540          
    25412597        // generate a texture that has the same size/format as the pbuffer 
    25422598        dynamicTexture = mRenderBuffer->generateDynamicTexture(); 
    2543  
    25442599        // bind the dynamic texture to the pbuffer - this is a no-op under X11 
    25452600        mRenderBuffer->bindToDynamicTexture(dynamicTexture); 
     
    26272682        { 
    26282683                cout << "replaying " << (int)sViewPointsList.size() << " view points " << endl; 
    2629  
     2684                 
    26302685                mReplayMode = true; 
     2686                 
     2687                if (mExportFrameBuffer) 
     2688                        GetPreprocessor()->mSynchronize = true; 
     2689 
     2690                sCurrentSamples = GetPreprocessor()->mCurrentSamples; 
    26312691                sViewPointsListIt = sViewPointsList.begin(); 
    26322692        } 
     
    26622722int QtGlRendererWidget::FindDynamicObject(float x, float y)  
    26632723{  
     2724 
     2725        if (GetPreprocessor()->mDynamicObjects.empty()) 
     2726                return -1; 
     2727 
    26642728        makeCurrent(); 
    2665         // we need to lock the rendering context  
    2666         //glw.lockGLContext();  
    26672729         
    26682730        // this is the same as in every OpenGL picking example  
     
    27152777        glPopMatrix(); 
    27162778 
    2717         int hits; 
     2779        int hits = glRenderMode(GL_RENDER); 
     2780 
    27182781        // finally release the rendering context again  
    2719         if ((hits = glRenderMode(GL_RENDER)) < 0)  
     2782        if (!hits)  
    27202783        {  
    27212784                cout << "no object picked" << endl; 
    2722                 //glw.unlockGLContext();  
    27232785                return -1;  
    27242786        }  
    27252787 
    2726  
    27272788        //processHits(hits, buffer); 
    2728  
    2729          
    2730         //glw.unlockGLContext();  
    27312789         
    27322790        // Each hit takes 4 items in the buffer.  
     
    27432801 
    27442802 
    2745 } 
     2803void QtGlRendererWidget::DeleteDynamicObject() 
     2804{ 
     2805        Preprocessor *p = GetPreprocessor(); 
     2806 
     2807        if ((mCurrentDynamicObjectIdx < 0) || 
     2808                (mCurrentDynamicObjectIdx >= p->mDynamicObjects.size())) 
     2809                return; 
     2810 
     2811        cout << "deleting object" << endl; 
     2812 
     2813        SceneGraphLeaf *l = p->mDynamicObjects[mCurrentDynamicObjectIdx]; 
     2814 
     2815        // tell the preprocessor that an object was deleted 
     2816        p->ObjectRemoved(l); 
     2817 
     2818        swap(p->mDynamicObjects[mCurrentDynamicObjectIdx], p->mDynamicObjects.back()); 
     2819        p->mDynamicObjects.pop_back(); 
     2820 
     2821        delete l; 
     2822 
     2823        mCurrentDynamicObjectIdx = -1; 
     2824}        
     2825 
     2826} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h

    r2704 r2709  
    7272        void RenderPvs(const ObjectPvs &pvs); 
    7373 
    74         float GetPixelError(int &pvsSize); 
     74        float GetPixelError(int &pvsSize, int pass); 
    7575 
    7676        int ComputePvs(ObjectContainer &objects, ObjectContainer &pvs) const; 
     
    114114  void ReplayViewPoints(); 
    115115  void UpdateDynamicObjects(); 
     116  void DeleteDynamicObject(); 
    116117  void ComputeVisibility(); 
    117118  void StopComputation(); 
     
    246247        ObjectPlacer *mPlacer; 
    247248 
    248         //DynamicObjectsContainer mPendingDynamicObjects; 
     249        int mCurrentDynamicObjectIdx; 
     250 
     251        bool mExportFrameBuffer; 
     252 
    249253        DynamicObjectsContainer mDynamicPvsObjects; 
    250254 
     
    334338        void ReplayViewPoints(); 
    335339        void UpdateDynamicObjects(); 
     340        void DeleteDynamicObject(); 
    336341        void UpdateAllPvs(); 
    337342        void ComputeVisibility(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp

    r2705 r2709  
    5252        // set viewer size here 
    5353        return QSize(512, 320); 
    54  
    5554        //return QSize(512, 384); 
    5655        //return QSize(640, 480); 
     
    6867 
    6968        GLfloat light_ambient[]  = {0.2f, 0.2f, 0.2f, 1.0f}; 
    70         GLfloat light_diffuse[]  = {0.4f, 0.4f, 0.4f, 1.0f}; 
     69        GLfloat light_diffuse[]  = {0.6f, 0.6f, 0.6f, 1.0f}; 
    7170        GLfloat light_specular[] = {0.3f, 0.3f, 0.3f, 1.0f}; 
    7271 
     
    8281        glLightfv (GL_LIGHT1, GL_POSITION, infinite_light2); 
    8382 
    84         // default material 
    85         /*glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat_ambient); 
    86         glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse); 
    87         glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular); 
    88         glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess); 
    89 */ 
    9083        // a light 
    9184        glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp

    r2666 r2709  
    1212#include "SamplingStrategy.h" 
    1313#include "RayCaster.h" 
    14  
     14#include <windows.h> 
    1515 
    1616 
     
    9494  while (samples < mTotalSamples) { 
    9595        for (int i=0; i < mSamplesPerPass;) { 
    96            
     96           while (mSynchronize) 
     97           { 
     98                   // hack: sleep during walthrough computation 
     99                   Sleep(1000); 
     100           } 
     101 
    97102          mRayCaster->InitPass(); 
    98103           
  • GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp

    r2702 r2709  
    278278 
    279279 
    280 SceneGraphLeaf::SceneGraphLeaf(): mIsDynamic(false) 
     280SceneGraphLeaf::SceneGraphLeaf(): mIsDynamic(false), mHasChanged(true) 
    281281{ 
    282282        mTrafo = IdentityMatrix(); 
     
    286286 
    287287 
    288 SceneGraphLeaf::SceneGraphLeaf(bool isDynamic): mIsDynamic(isDynamic) 
     288SceneGraphLeaf::SceneGraphLeaf(bool isDynamic): mIsDynamic(isDynamic), mHasChanged(true) 
    289289{ 
    290290    mTrafo = IdentityMatrix(); 
     
    294294void SceneGraphLeaf::ApplyTransform(const Matrix4x4 &trafo) 
    295295{ 
     296        mHasChanged = true; 
    296297        mTrafo = trafo * mTrafo; 
    297298} 
     
    300301void SceneGraphLeaf::LoadTransform(const Matrix4x4 &m) 
    301302{ 
     303        mHasChanged = true; 
    302304        mTrafo = m; 
    303305} 
     
    334336        mTrafo = copy.mTrafo; 
    335337        mIsDynamic = copy.mIsDynamic; 
    336 } 
    337  
    338 } 
     338        mHasChanged = true; 
     339} 
     340 
     341} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h

    r2702 r2709  
    7676        virtual void UpdateBox(); 
    7777 
     78        bool HasChanged() { return mHasChanged; } 
     79 
     80        void SetHasChanged(bool hasChanged) {mHasChanged = hasChanged;} 
    7881        SceneGraphLeafIntersectable *GetIntersectable() { return mIntersectable; } 
    7982 
     
    8588        ObjectContainer mGeometry; 
    8689 
    87  
    8890protected: 
    8991 
     
    9193 
    9294        bool mIsDynamic; 
     95        bool mHasChanged; 
     96 
    9397        Matrix4x4 mTrafo; 
    9498}; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SepPlanesBox3.cpp

    r2707 r2709  
    8787  Vector3 centerOrig = origBox.Center(); 
    8888  Vector3 centerShad = shadBox.Center(); 
    89   const float eps = 1e-3; 
     89  const float eps = 1e-3f; 
    9090  int cnt = 0; 
    9191   
     
    111111      // if (cnt == 17) { cout << "Problem " << endl; } 
    112112       
    113       int centerFlag = pl.Side(pointBACKSIDE, 1e-6); 
     113      int centerFlag = pl.Side(pointBACKSIDE, 1e-6f); 
    114114      if (centerFlag == Plane3:: INTERSECTS) 
    115115        continue; // plane crosses the center of the box! 
     
    141141  // test all edges of the axis aligned box 
    142142  Vector3 a,b; 
    143   const float eps = 1e-3; 
     143  const float eps = 1e-3f; 
    144144  Vector3 centerShad = shadBox.Center(); 
    145145 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r2707 r2709  
    171171 
    172172         
    173         TestSepAxis(); 
     173        //TestSepAxis(); 
    174174         
    175175        Environment::GetSingleton()->Parse(argc, argv, USE_EXE_PATH); 
     
    333333                // NOTE: render texture should be power of 2 and square 
    334334                // renderer must be initialised 
    335                 // $$matt 
     335                const float w = 640; 
     336                const float h = 480; 
     337 
    336338                QtGlRendererBuffer *glbuf =  
    337                         new QtGlRendererBuffer(1024, 1024, 
     339                        new QtGlRendererBuffer(w, h, 
    338340                                                                   preprocessor->mSceneGraph, 
    339341                                                                   preprocessor->mViewCellsManager, 
Note: See TracChangeset for help on using the changeset viewer.