- Timestamp:
- 10/16/05 12:42:54 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
r329 r330 9 9 # filename vienna.x3d 10 10 # filename ../data/vienna/vienna-simple.x3d 11 #filename ../data/vienna/vienna-buildings.x3d11 filename ../data/vienna/vienna-buildings.x3d 12 12 # filename ../data/vienna/viewcells-25-sel.x3d 13 filename ../data/atlanta/atlanta2.x3d13 # filename ../data/atlanta/atlanta2.x3d 14 14 # filename ../data/soda/soda.dat 15 15 # filename ../data/soda/soda5.dat … … 56 56 57 57 Sampling { 58 totalSamples 100000058 totalSamples 5000 59 59 samplesPerPass 20 60 60 } 61 61 62 62 ViewCells { 63 # 63 #hierarchy kdTree 64 64 hierarchy bspTree 65 65 # hierarchy sceneDependent … … 69 69 70 70 # filename ../data/atlanta/atlanta_viewcells_large.x3d 71 #filename ../data/vienna/viewcells-25-sel.x3d72 filename ../data/vienna/viewcells-25.x3d71 filename ../data/vienna/viewcells-25-sel.x3d 72 # filename ../data/vienna/viewcells-25.x3d 73 73 # filename ../data/vienna/viewcells-large-sel.x3d 74 74 } … … 79 79 # input fromViewCells 80 80 # input fromSceneGeometry 81 samples 5000081 samples 3000 82 82 sideTolerance 0.002 83 83 } -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r329 r330 151 151 // cast ray to KD tree to find intersection with other objects 152 152 mKdTree->CastRay(ray); 153 cout << "k";153 154 154 if (mViewCellsType == BSP_VIEW_CELLS) 155 155 { … … 157 157 if (mBspTree) 158 158 { 159 cout << "uhhhhhhh year" << endl;160 159 mBspTree->CastRay(ray); 161 160 … … 171 170 else 172 171 { 173 cout << "z" << endl;174 172 if (ray.leaves.size()) { 175 173 sampleContributions += AddNodeSamples(object, ray); … … 308 306 cout << "totalSamples: " << totalSamples; 309 307 for (i = 0; i < objects.size(); i++) { 310 printf("\nsampling object %d of %d, samples %d\n", i, (int)objects.size(), passSamples); 308 309 Debug << "\nsampling object " << i << " of " << (int)objects.size() << " sample " << passSamples << endl; 311 310 312 311 KdNode *nodeToSample = NULL; … … 373 372 int sampleContributions; 374 373 374 long startTime = GetTime(); 375 375 376 if (viewcellSample) { 376 377 nodeToSample = mKdTree->GetRandomLeaf(Plane3(normal, point)); 377 378 378 379 for (int k=0; k < mSamplesPerPass; k++) { 379 380 if (nodeToSample) { … … 396 397 // construct a ray 397 398 SetupRay(ray, point, direction); 398 cout << "s";399 399 400 sampleContributions = CastRay(object, ray); 400 cout << "r"; 401 402 // CORR matt: put inside loop 403 if ( i < pvsOut ) 404 rays[i].push_back(ray); 405 406 if (!ray.intersections.empty()) { 407 // check whether we can add this to the rays 408 for (int j = 0; j < pvsOut; j++) { 409 if (objects[j] == ray.intersections[0].mObject) { 410 rays[j].push_back(ray); 411 } 412 } 413 } 414 401 415 if (mViewCellsType == BSP_VIEW_CELLS) 402 416 { … … 435 449 // object->GetRandomVisibleMesh(Plane3(normal, point)); 436 450 } 437 438 // NOTE: should be inside loop 439 if ( i < pvsOut ) 440 rays[i].push_back(ray); 441 442 if (!ray.intersections.empty()) { 443 // check whether we can add this to the rays 444 for (int j = 0; j < pvsOut; j++) { 445 if (objects[j] == ray.intersections[0].mObject) { 446 rays[j].push_back(ray); 447 } 448 } 449 } 450 451 passSamples++; 451 long t = TimeDiff(startTime, GetTime()); 452 Debug << "pass time: " << t << endl; 453 454 passSamples += mSamplesPerPass; 452 455 453 456 if (sampleContributions) { … … 456 459 } 457 460 } 458 cout << "pass samples: " << passSamples << endl; 459 totalSamples += passSamples; 461 462 // CORR matt: must add pass samples 463 totalSamples += passSamples; // totalSamples ++; 460 464 461 465 // if (pass>10) … … 588 592 if (!objects[j]->Mailed()) 589 593 { 594 //if (j == 2198)m.mDiffuseColor = RgbColor(1, 0, 1); 595 //else m.mDiffuseColor = RgbColor(1, 1, 0); 596 exporter->SetForcedMaterial(m); 590 597 exporter->ExportIntersectable(objects[j]); 591 598 objects[j]->Mail(); -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r329 r330 672 672 673 673 long startTime = GetTime(); 674 cout << "**** Contructing tree using scene geometry****\n";674 cout << "**** Contructing bsp tree ****\n"; 675 675 676 676 while (!tStack.empty()) … … 831 831 // partition rays 832 832 interior->SplitRays(rays, frontRays, backRays); 833 Debug << "jdfjfj43" << endl;833 834 834 // split polygons with split plane 835 835 mStat.splits +=interior->SplitPolygons(polys, -
trunk/VUT/GtpVisibilityPreprocessor/src/main.cpp
r329 r330 57 57 } 58 58 59 Debug << "do2" << endl;60 59 p->BuildBspTree(); 61 60 p->Export("vc_bsptree.x3d", false, false, true); … … 64 63 bool exportSplits = false; 65 64 environment->GetBoolValue("BspTree.exportSplits", exportSplits); 66 Debug << "do3" << endl; 65 67 66 // export the bsp splits 68 67 if (exportSplits)
Note: See TracChangeset
for help on using the changeset viewer.