Index: GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h	(revision 2740)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h	(revision 2741)
@@ -297,14 +297,12 @@
 	void PrepareProbablyVisibleSampling();
 	
-	void CreateRandomizedReverseRays(const Vector3 &origin, 
-		                             const Vector3 &termination, 
-									 const Triangle3 &triangle,                   
+	void CreateRandomizedReverseRays(const VssRay &ray, 
+		                             const Vector3 &predictedPoint, 
 									 SimpleRayContainer &rays, 
 									 int number);
 
-	bool CreateRandomizedReverseRay(const Vector3 &origin, 
-		                            const Vector3 &termination,
-									const Triangle3 &triangle,
-									SimpleRay &ray);
+	bool CreateRandomizedReverseRay(const VssRay &ray, 
+		                            const Vector3 &predictedPoint,
+									SimpleRay &simpleray);
 
 	inline bool IntersectsViewCell(Vector3 &origin, const Vector3 &dir) const;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2738)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2741)
@@ -257,5 +257,5 @@
 		GLfloat mat_ambient[] = {0.5f, 0.5f, 0.5f, 1.0f};
 		GLfloat mat_diffuse[] = {1.0f, 1.0f, 1.0f, 1.0f};
-		GLfloat mat_specular[] = {0.3f, 0.3f, 0.3f, 1.0f};
+		GLfloat mat_specular[] = {0.5f, 0.5f, 0.5f, 1.0f};
 		GLfloat mat_shininess[] = {1.0f};
 
@@ -285,6 +285,6 @@
 		glEnable(GL_COLOR_MATERIAL);
 
-		GLfloat lmodel_ambient[] = {0.3f, 0.3f, 0.3f, 1.0f};
-		glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+		GLfloat lmodel_ambient[] = {0.5f, 0.5f, 0.5, 1.0f};
+		//glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
 
 		glShadeModel(GL_SMOOTH);
Index: GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp	(revision 2740)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp	(revision 2741)
@@ -234,5 +234,5 @@
 	simpleRays.clear();
 
-	CreateRandomizedReverseRays(currentRay.mOrigin, predictedHit, hitTriangle, simpleRays, 16);
+	CreateRandomizedReverseRays(currentRay, predictedHit, simpleRays, 16);
 
 	static VssRayContainer reverseRays;
@@ -679,5 +679,5 @@
 
 
-#if 0
+#if 1
 	for (size_t i = 0; i < vssRays.size(); ++ i)
 	{
@@ -1577,5 +1577,5 @@
 			
 			// compute the pixel error of this visibility solution
-			if (0 && mEvaluatePixelError)
+			if (1 && mEvaluatePixelError)
 				ComputeRenderError();
 		}
@@ -2040,7 +2040,6 @@
 
 
-void GvsPreprocessor::CreateRandomizedReverseRays(const Vector3 &origin, 
-												  const Vector3 &termination, 
-												  const Triangle3 &triangle,                   
+void GvsPreprocessor::CreateRandomizedReverseRays(const VssRay &ray, 
+												  const Vector3 &predictedPoint, 
 												  SimpleRayContainer &rays, 
 												  int number)
@@ -2052,7 +2051,7 @@
 	while (((rays.size() - currentNumber) < number) && (tries ++ < 20))
 	{
-		SimpleRay ray;
-		if (CreateRandomizedReverseRay(origin, termination, triangle, ray))
-			rays.push_back(ray);
+		SimpleRay simpleRay;
+		if (CreateRandomizedReverseRay(ray, predictedPoint, simpleRay))
+			rays.push_back(simpleRay);
 	}
 
@@ -2061,17 +2060,15 @@
 
 
-bool GvsPreprocessor::CreateRandomizedReverseRay(const Vector3 &origin, 
-												 const Vector3 &termination, 
-												 const Triangle3 &triangle,                   
-												 SimpleRay &ray)
-{
-	//Vector3 nd = triangle.GetNormal();
+bool GvsPreprocessor::CreateRandomizedReverseRay(const VssRay &ray, 
+												 const Vector3 &predictedPoint, 
+												 SimpleRay &simpleRay)
+{
+	//Vector3 nd = ray.GetNormalizedDir();
 	const AxisAlignedBox3 box = mCurrentViewCell->GetBox();
-	Vector3 nd = box.GetNearestFace(origin).GetNormal();
+	//Vector3 nd = box.GetNearestFace(origin).GetNormal();
 	//cout << "pt: " << origin << " face: " << box.GetNearestFace(origin) << endl;
-	nd.Normalize();
 
 	// Compute right handed coordinate system from direction
-	Vector3 U, V;
+	/*Vector3 U, V;
 	nd.RightHandedBase(U, V);
 	
@@ -2082,5 +2079,5 @@
 
 	Vector2 vr2(rr[0], rr[1]);
-	const float sigma = triangle.GetBoundingBox().Radius() * mRadiusOfInfluence;
+	const float sigma = 1.0f;//triangle.GetBoundingBox().Radius() * mRadiusOfInfluence;
 	Vector2 gaussvec2;
 
@@ -2090,8 +2087,9 @@
 	const Vector3 shift = gaussvec2.xx * U + gaussvec2.yy * V;
 
-	Vector3 newOrigin = origin + shift;
+	Vector3 newOrigin = ray.mOrigin + shift;
+	*/
 	//cout << "o: " << origin << " new o: " << newOrigin << endl;
-
-	Vector3 direction = termination - newOrigin;
+	Vector3 newOrigin = box.GetRandomPoint();
+	Vector3 direction = predictedPoint - newOrigin;
 
 	const float len = Magnitude(direction);
@@ -2102,5 +2100,5 @@
 	direction /= len;
 
-	if (!IntersectsViewCell(newOrigin, -direction))
+	if (0 && !IntersectsViewCell(newOrigin, -direction))
 	{
 		//cout << "x";
@@ -2111,5 +2109,5 @@
 	// $$ jb the pdf is yet not correct for all sampling methods!
 	const float pdf = 1.0f;
-	ray = SimpleRay(newOrigin, direction, SamplingStrategy::GVS, pdf);
+	simpleRay = SimpleRay(newOrigin, direction, SamplingStrategy::GVS, pdf);
 	
 	return true;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp	(revision 2735)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp	(revision 2741)
@@ -829,5 +829,6 @@
 	{
 		//mViewCell->GetRandomEdgePoint(origin, normal);
-		origin = mViewCell->GetBox().GetRandomSurfacePoint();
+		//origin = mViewCell->GetBox().GetRandomSurfacePoint();
+		origin = mViewCell->GetBox().GetRandomPoint();
 
 		// move a little bit back to avoid piercing through walls
