Changeset 3268


Ignore:
Timestamp:
01/11/09 22:54:05 (15 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/ObjConverter2.cpp

    r3265 r3268  
    128128                                for (int j = 0; j < 3; ++ j) 
    129129                                { 
    130                                         if (tIndices[idx[j]] >= (int)texcoords.size()) 
    131                                                 cerr << "error: texcoord indices exceed array size " << texcoords.size() << " " << tIndices[idx[j]] << endl; 
     130                                        //if (tIndices[idx[j]] >= (int)texcoords.size()) 
     131                                                //cerr << "error: texcoord indices exceed array size " << texcoords.size() << " " << tIndices[idx[j]] << endl; 
    132132                                        const int tidx = min((int)texcoords.size() - 1, tIndices[idx[j]]); 
    133133 
     
    240240        vector<string>::const_iterator it, it_end = filenames.end(); 
    241241 
     242        ofstream outstr("mydebug.log"); 
     243 
    242244        for (it = filenames.begin(); it != it_end; ++ it) 
    243245        { 
     
    245247 
    246248                cout << "\n==================\n loading file " << filename << endl; 
     249 
     250                outstr << "loading file: " << filename << endl; 
     251                outstr << flush; 
    247252 
    248253                if (!ReadFile(filename)) 
     
    253258        } 
    254259 
    255         cout << "\n*******************\n writing file " << outputFilename << endl; 
     260        cout << "\n*******************\nwriting file " << outputFilename << endl; 
    256261 
    257262        if (!WriteFile(outputFilename)) 
     
    385390                                { 
    386391                                        cerr << "loading material library failed" << endl; 
    387                                         exit(0); 
     392                                        return false; 
    388393                                } 
    389394                        } 
     
    538543        } 
    539544 
     545        ofile.close(); 
     546 
    540547        return true; 
    541548} 
     
    545552{ 
    546553        FILE *file; 
    547  
    548554        if ((file = fopen(matFileName.c_str(), "r")) == NULL) return false; 
    549555         
     
    610616        } 
    611617 
     618        fclose(file); 
     619 
    612620        return true; 
    613621} 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/main.cpp

    r3265 r3268  
    3131#else 
    3232         
    33         //const int numFiles = 879; 
    34         const int numFiles = 10; 
     33        const int numFiles = 879; 
     34        //const int numFiles = 300; 
    3535 
    3636        vector<string> filenames; 
    3737        const string base(model_path + argv[1]); 
    3838 
     39        char filename[100]; 
     40 
    3941        for (int i = 0; i < numFiles; ++ i) 
    4042        { 
    41                 char filename[100]; 
    4243                sprintf(filename, "%s%s%d%s", base.c_str(), ".b", i, ".obj"); 
    4344                filenames.push_back(filename); 
    4445        } 
     46 
     47        //cout << "press any key" << std::cin.get(); 
    4548 
    4649        if (!converter.Convert2(filenames, model_path + argv[2])) 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/MainApp.vcproj

    r3266 r3268  
    155155                                IgnoreAllDefaultLibraries="false" 
    156156                                IgnoreDefaultLibraryNames="LIBCMT" 
    157                                 GenerateDebugInformation="true" 
     157                                GenerateDebugInformation="false" 
    158158                                SubSystem="1" 
    159159                                LargeAddressAware="2" 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env

    r3262 r3268  
    88 
    99filename=vienna_full_hp 
     10filename=procedural_pompeii_area6_hires/pompeii 
    1011#filename=city 
    1112useLODs=1 
     
    4748 
    4849# initial camera position 
    49 camPosition=483.398f 242.364f 186.078f 
     50#camPosition=483.398f 242.364f 186.078f 
     51camPosition=1300.0f -2500.0f 10.0f 
     52 
    5053# initial camera orientation 
    5154camDirection=1 0 0 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/BvhConstructor.cpp

    r3267 r3268  
    130130                // no split could be achieved => just halve number of objects 
    131131                split = (leaf->mLast + leaf->mFirst) / 2; 
    132                 cerr << "no reduction " << leaf->CountPrimitives() << " " << leaf->mFirst << " " << leaf->mLast << endl; 
     132                //cerr << "no reduction " << leaf->CountPrimitives() << " " << leaf->mFirst << " " << leaf->mLast << endl; 
    133133        } 
    134134 
     
    185185        BvhLeaf *l = new BvhLeaf(NULL); 
    186186         
    187         l->mBox = SceneEntity::ComputeBoundingBox(mEntities + mFirst, mFirst - mLast + 1); 
    188  
    189187        l->mFirst = mFirst; 
    190188        l->mLast = mLast; 
     189 
     190        cout << "constructing bvh from "  << l->mFirst << " to " << l->mLast << endl; 
     191 
     192        l->mBox = SceneEntity::ComputeBoundingBox(mEntities + mFirst, mLast - mFirst + 1); 
    191193        l->mArea = l->mBox.SurfaceArea(); 
    192194         
    193         cout << "constructing bvh from "  << l->mFirst << " to " << l->mLast << endl; 
    194  
    195195        root = SubdivideLeaf(l, 0); 
    196196 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntity.cpp

    r3262 r3268  
    187187        AxisAlignedBox3 box; 
    188188         
    189         if (!numEntities) 
     189        if (numEntities <= 0) 
    190190        {       // no box => just initialize 
    191191                box.Initialize(); 
     
    209209        AxisAlignedBox3 box; 
    210210         
    211         if (!entities.empty()) 
     211        if (entities.empty()) 
    212212        {       // no box => just initialize 
    213213                box.Initialize(); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.cpp

    r3250 r3268  
    109109 
    110110        // scale the sky dome so no intersection with the scene is visible 
    111         //const float scaleFactor = 80.0f; 
    112         const float scaleFactor = 500.0f; 
     111        const float scaleFactor = 80.0f; 
     112        //const float scaleFactor = 500.0f; 
    113113 
    114114        position.z -= 3.0f * scaleFactor; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r3267 r3268  
    587587        //LoadModel("sibenik.dem", dynamicObjects); 
    588588 
    589         LoadModel("procedural_pompeii_area6_hires/pompeii.dem", dynamicObjects); 
    590  
     589        //LoadModel("procedural_pompeii_area6_hires/pompeii.dem", dynamicObjects); 
     590/* 
    591591        AxisAlignedBox3 box; 
    592592        box.Initialize(); 
     
    603603 
    604604        cout << "pompeii bb:\n" << box << endl; 
    605  
     605*/ 
    606606#if 0 
    607607        const Vector3 sceneCenter(470.398f, 240.364f, 181.7f); 
     
    645645 
    646646        BvhFactory bvhFactory; 
    647         //bvh = bvhFactory.Create(bvh_filename, staticObjects, dynamicObjects, maxDepthForTestingChildren); 
     647#if 1 
    648648        bvh = bvhFactory.Create(staticObjects, dynamicObjects, maxDepthForTestingChildren); 
     649#else 
     650        bvh = bvhFactory.Create(bvh_filename, staticObjects, dynamicObjects, maxDepthForTestingChildren); 
     651#endif 
    649652 
    650653        if (!bvh) 
Note: See TracChangeset for help on using the changeset viewer.