Changeset 1769


Ignore:
Timestamp:
11/20/06 11:35:26 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
5 edited

Legend:

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

    r1768 r1769  
    802802 
    803803        // get random edge of face (hack: this is not uniform in the edges! 
    804         const int edgeIdx = (int)RandomValue(0.0f, face->mVertexIndices.size() - 0.5f); 
    805  
     804        const int edgeIdx = (int)RandomValue(0.0f, (float)face->mVertexIndices.size() - 0.5f); 
     805 
     806        //cout << "idx = " << edgeIdx << " s: " << face->mVertexIndices.size() << endl; 
    806807        const int vertexIdxA = face->mVertexIndices[edgeIdx]; 
    807808        const int vertexIdxB = face->mVertexIndices[(edgeIdx + 1) % (int)face->mVertexIndices.size()]; 
     
    815816        point = a * w + b * (1.0f - w); 
    816817 
     818        //cout << "va " << a << " vb " << b << "p " << point << endl; 
    817819        // hack: set normal of face as normal 
    818820        normal = mMesh->GetFacePlane(faceIdx).mNormal; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r1768 r1769  
    986986        case SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION: 
    987987                return new ReverseObjectBasedDistribution(*this); 
     988        case SamplingStrategy::VIEWCELL_BORDER_BASED_DISTRIBUTION: 
     989                return new ViewCellBorderBasedDistribution(*this); 
    988990        //case OBJECTS_INTERIOR_DISTRIBUTION: 
    989991        //      return new ObjectsInteriorDistribution(*this); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp

    r1768 r1769  
    199199        Vector3 normal, normal2; 
    200200         
    201         //cout << "y"; 
    202201        const int vcIdx = (int)RandomValue(0, (float)viewCells.size() - 0.5f); 
    203202        const int objIdx = (int)RandomValue(0, (float)mPreprocessor.mObjects.size() - 0.5f); 
     
    206205        ViewCell *viewCell = viewCells[vcIdx]; 
    207206 
     207        //cout << "vc: " << vcIdx << endl; 
     208        //cout << "obj: " << objIdx << endl; 
     209 
    208210        object->GetRandomSurfacePoint(point, normal); 
    209211        viewCell->GetRandomEdgePoint(origin, normal2); 
     
    214216        const float c = Magnitude(direction); 
    215217 
    216         if ((c <= Limits::Small) || (DotProd(direction, normal) < 0)) 
     218        if ((c <= Limits::Small) /*|| (DotProd(direction, normal) < 0)*/) 
    217219        { 
    218220                return false; 
     
    224226        direction *= 1.0f / c; 
    225227        ray = SimpleRay(origin, direction, pdf); 
    226          
     228 
     229        //cout << "ray: " << ray.mOrigin << " " << ray.mDirection << endl; 
     230 
    227231        return true; 
    228232} 
     
    258262        return true; 
    259263} 
     264 
    260265#endif 
    261266} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h

    r1763 r1769  
    2828                 OBJECT_DIRECTION_BASED_DISTRIBUTION, 
    2929                 OBJECTS_INTERIOR_DISTRIBUTION, 
    30                  REVERSE_OBJECT_BASED_DISTRIBUTION 
     30                 REVERSE_OBJECT_BASED_DISTRIBUTION, 
     31                 VIEWCELL_BORDER_BASED_DISTRIBUTION 
    3132         }; 
    3233 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r1768 r1769  
    551551         
    552552        ///////////////// 
    553         //-- Finally, we do some visualization 
     553        //-- Show some visualizations 
    554554 
    555555        if (mShowVisualization) 
    556556        { 
     557                cout << "************************\n*********************\n"; 
     558                if (0) 
     559                { 
     560                        strategies.clear(); 
     561                        strategies.push_back(SamplingStrategy::VIEWCELL_BORDER_BASED_DISTRIBUTION); 
     562                } 
     563 
    557564                /////////////// 
    558565                //-- visualization rays, e.g., to show some samples in the scene 
     
    55015508        int leafOut; 
    55025509        Environment::GetSingleton()->GetIntValue("ViewCells.Visualization.maxOutput", leafOut); 
     5510 
     5511        const bool sortViewCells = false; 
     5512        const bool exportPvs = true; 
     5513        const bool exportRays = true; 
    55035514        const int raysOut = 100; 
    55045515 
    5505         ExportSingleViewCells(objects, leafOut, false, true, false, raysOut, ""); 
     5516        ExportSingleViewCells(objects,  
     5517                                                  leafOut,  
     5518                                                  sortViewCells,  
     5519                                                  exportPvs,  
     5520                                                  exportRays,  
     5521                                                  raysOut,  
     5522                                                  ""); 
    55065523} 
    55075524 
     
    59435960        strategies.push_back(SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION); 
    59445961        strategies.push_back(SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION); 
    5945  
     5962//strategies.push_back(SamplingStrategy::VIEWCELL_BORDER_BASED_DISTRIBUTION); 
    59465963        cout << "reseting pvs ... "; 
    59475964                 
Note: See TracChangeset for help on using the changeset viewer.