Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2925)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2927)
@@ -70,5 +70,6 @@
 int renderMode = RenderTraverser::CHCPLUSPLUS;
 // eye near plane distance
-float nearDist = 2.0f; 
+float nearDist = 0.1f;
+float farDist = 1e6f;
 /// the field of view
 float fov = 50.0f;
@@ -104,6 +105,4 @@
 double accumulatedTime = 1000;
 float fps = 1e3f;
-
-float myfar = 0;
 
 glfont::GLFont myfont;
@@ -428,5 +427,5 @@
 
 	// set far plane based on scene extent
-	myfar = 10.0f * Magnitude(bvh->GetBox().Diagonal());
+	farDist = 10.0f * Magnitude(bvh->GetBox().Diagonal());
 	bvh->SetVirtualLeaves(trianglesPerVirtualLeaf);
 
@@ -512,5 +511,5 @@
 		Material::sAmbientTexParam = cgGetNamedParameter(RenderState::sCgMrtFragmentTexProgram, "ambient");
 
-		cgGLSetParameter1f(sMaxDepthParamTex, MAX_DEPTH_CONST / myfar);
+		cgGLSetParameter1f(sMaxDepthParamTex, MAX_DEPTH_CONST / farDist);
 		//Debug << "maxdepth: " << MAX_DEPTH_CONST / myfar << endl;
 	}
@@ -534,5 +533,5 @@
 		Material::sAmbientParam = cgGetNamedParameter(RenderState::sCgMrtFragmentProgram, "ambient");
 
-		cgGLSetParameter1f(sMaxDepthParam, MAX_DEPTH_CONST / myfar);
+		cgGLSetParameter1f(sMaxDepthParam, MAX_DEPTH_CONST / farDist);
 	}
 	else
@@ -791,5 +790,5 @@
 	glLoadIdentity();
 
-	gluPerspective(fov, winAspectRatio, nearDist, myfar);
+	gluPerspective(fov, winAspectRatio, nearDist, farDist);
 
 	glMatrixMode(GL_MODELVIEW);
@@ -1025,5 +1024,5 @@
 		cgGLDisableProfile(RenderState::sCgFragmentProfile);
 
-		if (!ssaoShader) ssaoShader = new DeferredRenderer(texWidth, texHeight, camera, myfar / MAX_DEPTH_CONST);
+		if (!ssaoShader) ssaoShader = new DeferredRenderer(texWidth, texHeight, camera, farDist / MAX_DEPTH_CONST);
 		
 		DeferredRenderer::SHADING_METHOD shadingMethod;
@@ -1373,5 +1372,5 @@
 	glLoadIdentity();
 
-	gluPerspective(fov, winAspectRatio, nearDist, myfar);
+	gluPerspective(fov, winAspectRatio, nearDist, farDist);
 
 	glMatrixMode(GL_MODELVIEW);
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Camera.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Camera.cpp	(revision 2926)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Camera.cpp	(revision 2927)
@@ -12,5 +12,5 @@
 
 // our coordinate system has the positive z axis pointing up
-static const Vector3 baseDir = Vector3::UNIT_Y();
+static Vector3 baseDir = Vector3(0, 1, 0);
 
 
@@ -51,9 +51,9 @@
 void Camera::Precompute(const Vector3 &direction) 
 {
-	Vector3 up = Vector3::UNIT_Z();
-	Vector3 right = Normalize(CrossProd(up, -direction));
-	up = Normalize(CrossProd(-direction, right));
-
-	mBaseOrientation = Matrix4x4(right, up, -direction);
+	Vector3 up = Vector3(0, 0, 1);
+	Vector3 right = Normalize(CrossProd(up, direction));
+	up = Normalize(CrossProd(direction, right));
+
+	mBaseOrientation = Matrix4x4(right, up, direction);
 	mViewOrientation = mBaseOrientation;
 }
@@ -88,9 +88,9 @@
 	mat = mViewOrientation;
 
-	const Vector3 pos = mViewOrientation * -mPosition;
+	Vector3 pos = mViewOrientation * -mPosition;
 	
 	mat.x[3][0] = pos.x;
 	mat.x[3][1] = pos.y;
-	mat.x[3][2] = -pos.z;
+	mat.x[3][2] = pos.z;
 
 	//glGetFloatv(GL_MODELVIEW_MATRIX, (float *)mat.x);
@@ -129,9 +129,9 @@
 	Matrix4x4 viewOrientation = mViewOrientation;
 
-	const Vector3 pos = mViewOrientation * -mPosition;
+	Vector3 pos = mViewOrientation * -mPosition;
 
 	viewOrientation.x[3][0] = pos.x;
 	viewOrientation.x[3][1] = pos.y;
-	viewOrientation.x[3][2] = -pos.z;
+	viewOrientation.x[3][2] = pos.z;
 
 	glLoadMatrixf((float *)viewOrientation.x);
@@ -220,5 +220,5 @@
 void Camera::SetDirection(const Vector3 &dir)
 {
-	Vector3 ndir = Normalize(dir);
+	Vector3 ndir = -Normalize(dir);
 
 	mPitch = -atan2(ndir.x, ndir.y);
@@ -243,5 +243,5 @@
 Vector3 Camera::GetDirection() const
 { 
-	return Vector3(mViewOrientation.x[0][2], mViewOrientation.x[1][2], mViewOrientation.x[2][2]);
+	return -Vector3(mViewOrientation.x[0][2], mViewOrientation.x[1][2], mViewOrientation.x[2][2]);
 }
 
@@ -261,5 +261,5 @@
 Vector3 Camera::GetBaseDirection() const
 { 
-	return Vector3(mBaseOrientation.x[0][2], mBaseOrientation.x[1][2], mBaseOrientation.x[2][2]);
+	return -Vector3(mBaseOrientation.x[0][2], mBaseOrientation.x[1][2], mBaseOrientation.x[2][2]);
 }
 
