Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/vienna.env
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/vienna.env	(revision 942)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/vienna.env	(revision 1052)
@@ -112,4 +112,6 @@
 
 	maxDepth 	40
+
+
 	minPvs		3
 	minRays		30
@@ -222,6 +224,5 @@
 		refine false
 		compress false
-		merge true
-		emptyViewCellsMerge false
+		merge false
 	}
 
@@ -251,5 +252,5 @@
 		samplingType box
 		histogram true
-		histoPasses 5000
+		histoStepSize 5000
 	}
 
@@ -270,41 +271,4 @@
 }
 
-
-VspKdTree {
-	epsilon		1e-6
-
-	Construction {
-		samples 500000
-	}
-	
-	Termination {
-		maxDepth	 	40
-		minPvs			0
-		minRays			1
-		minSize			0.001
-		maxCostRatio		5.9
-		maxViewCells		169
-		missTolerance		4
-		maxRayContribution 	2.5
-	}
-	
-	maxTotalMemory	100
-	maxStaticMemory	40
-
-	splitType 	regular
-	#splitType 	heuristics
-	splitUseOnlyDrivingAxis true
-	ct_div_ci	0.0
-	
-	PostProcess {
-		maxCostRatio 0.005
-		minViewCells 10000
-		maxPvsSize   5000
-	}
-	
-	
-	Visualization {
-	}
-}
 
 VspBspTree {
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp	(revision 1047)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp	(revision 1052)
@@ -1238,8 +1238,6 @@
 				SetForcedMaterial(RandomMaterial());
 			}
-
 			ExportIntersectable(*oit);
 		}
-
 		return;
 	}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp	(revision 1027)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp	(revision 1052)
@@ -564,5 +564,5 @@
 	box.SetMax(1, box.Min(1));
 
-  cout<<"mUseViewSpaceBox="<<mUseViewSpaceBox<<endl;
+  cout << "use view space box=" << mUseViewSpaceBox<<endl;
 
 
@@ -575,22 +575,29 @@
 	  else
 	  {
-		  // HACK: enlarge in y directon
 		  mViewSpaceBox = new AxisAlignedBox3(mKdTree->GetBox());
 
-		  if (1) 
+		  if (0) 
 		  {
-			  //Vector3 pmin = mViewSpaceBox->Min();
+			  // HACK: enlarge in y directon
 			  Vector3 size = mViewSpaceBox->Size();
-			  //size[1] *= 1.25;
-			  //Vector3 enlarge(size[0] * 0.25f, size[1] * 0.0f, size[2] * 0.25f);
-			  Vector3 enlarge(size[0] * 4.0f, 0.0f, 0.0f);
-
-			  //mViewSpaceBox->Enlarge(enlarge);
+			
+			  size[1] *= 1.25;
+			  Vector3 enlarge(size[0] * 0.25f, size[1] * 0.0f, size[2] * 0.25f);
+			  //Vector3 enlarge(size[0] * 4.0f, 0.0f, 0.0f);
+
+			  mViewSpaceBox->Enlarge(enlarge);
 			  mViewSpaceBox->SetMax(mViewSpaceBox->Max() + enlarge);
 		  } 
 		  else 
 		  {
+			  AxisAlignedBox3 tbox(*mViewSpaceBox);
+
+			  Vector3 size = mViewSpaceBox->Size();
+			  tbox.SetMax(0, mViewSpaceBox->Max(0) + size[0] * 0.5);
+			  tbox.SetMin(0, mViewSpaceBox->Min(0) + size[0]);
+			  *mViewSpaceBox = tbox;
+
 			  // $$ JB temporary
-			  AxisAlignedBox3 tempbox = *mViewSpaceBox;
+			  /*AxisAlignedBox3 tempbox = *mViewSpaceBox;
 			  
 			  float s = tempbox.Size(0);
@@ -599,5 +606,5 @@
 			  tempbox.SetMax(0, box.Max(0) + s*0.8f);
 			  tempbox.SetMin(0, box.Min(0) + s*0.8f);
-			  *mViewSpaceBox = tempbox;
+			  *mViewSpaceBox = tempbox;*/
 		  }		
 	  }
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp	(revision 1047)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp	(revision 1052)
@@ -777,5 +777,5 @@
 			++ contributingSamples;
 		
-		if (1) leaf->mVssRays.push_back(new VssRay(*ray));
+		if (0) leaf->mVssRays.push_back(new VssRay(*ray));
 	}
 }
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1047)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1052)
@@ -4159,6 +4159,6 @@
 	{	
 		// hack pvs
-		const int savedColorCode = mColorCode;
-		mColorCode = 1;
+		//const int savedColorCode = mColorCode;
+		//mColorCode = 1;
 	
 		Exporter *exporter = Exporter::GetExporter("final_view_cells.wrl");
@@ -4176,5 +4176,13 @@
 			}
 
-			if (mExportGeometry)
+			Material m; 
+
+			m.mDiffuseColor.r = 0.0f;
+			m.mDiffuseColor.g = 0.5f;
+			m.mDiffuseColor.b = 0.5f;
+
+            exporter->SetForcedMaterial(m);
+
+			if (0 && mExportGeometry)
 			{
 				exporter->ExportGeometry(objects);
@@ -4184,5 +4192,5 @@
 			if (0 && mExportRays)
 			{
-				exporter->ExportRays(visRays, RgbColor(0, 1, 0));
+				exporter->ExportRays(visRays, RgbColor(1, 0, 0));
 			}
 
@@ -4191,5 +4199,5 @@
 			// HACK: export without clip plane
 			const bool b = mUseClipPlaneForViz;
-			mUseClipPlaneForViz = false;
+			//mUseClipPlaneForViz = false;
 
 			ExportViewCellsForViz(exporter);
@@ -4201,5 +4209,5 @@
 		}
 
-		mColorCode = savedColorCode;
+		//mColorCode = savedColorCode;
 	}
 
@@ -4398,5 +4406,5 @@
 				}
 
-				Debug << "here233 " << (int)vcRays.size() << endl;
+				//Debug << "#rays: " << (int)vcRays.size() << endl;
 
 				//-- export rays piercing this view cell
@@ -4606,5 +4614,5 @@
 			mVspBspTree->ConstructGeometry(leaf, geom);
 
-			const float eps = 0.00000001f;
+			const float eps = 0.0001f;
 			const int cf = geom.Side(plane, eps);
 
@@ -5245,5 +5253,5 @@
 
 			// export rays
-			if (0 && mExportRays)
+			if (1 && mExportRays)
 			{
 				exporter->ExportRays(visRays, RgbColor(0, 1, 0));
@@ -5253,10 +5261,10 @@
 
 			// HACK: export without clip plane
-			//const bool b = mUseClipPlaneForViz;
-			//mUseClipPlaneForViz = false;
+			const bool b = mUseClipPlaneForViz;
+			mUseClipPlaneForViz = false;
 
 			ExportViewCellsForViz(exporter);
 			
-			//mUseClipPlaneForViz = b;
+			mUseClipPlaneForViz = b;
 			delete exporter;
 
