Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Visualization.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Visualization.cpp	(revision 2787)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Visualization.cpp	(revision 2788)
@@ -14,4 +14,6 @@
 namespace CHCDemoEngine
 {
+
+	GLUquadric *mSphere;
 
 /******************************************************/
@@ -30,4 +32,5 @@
 mFrameId(0)
 {
+	mSphere = (GLUquadric *)gluNewQuadric();
 }
 
@@ -56,8 +59,14 @@
 	tStack.push(mBvh->GetRoot());
 
+	glDisable(GL_LIGHTING);
+	
+	RenderViewPoint();
+	RenderFrustum();
+	RenderBox(mBvh->GetBox());
+
+	glEnable(GL_LIGHTING);
+
 	glEnableClientState(GL_VERTEX_ARRAY);
 	glEnableClientState(GL_NORMAL_ARRAY);
-
-	RenderFrustum();
 
 	while (!tStack.empty())
@@ -146,5 +155,4 @@
 
 	glEnable(GL_CULL_FACE);
-
 	glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
 }
@@ -153,4 +161,6 @@
 void Visualization::RenderFrustum()
 {
+	glColor3f(1.0f, 0.0f, 0.0f);
+
 	Vector3 ftl, ftr, fbl, fbr, ntl, ntr, nbl, nbr;
 	mCamera->ComputePoints(ftl, ftr, fbl, fbr, ntl, ntr, nbl, nbr);
@@ -202,3 +212,23 @@
 
 
-}
+
+void Visualization::RenderViewPoint()
+{
+	glPushMatrix();
+	Vector3 pos = mCamera->GetPosition();
+	pos.z += 100;
+	glTranslatef(pos.x, pos.y, pos.z);
+	
+	glScalef(5.0f, 5.0f, 5.0f);
+	glPushAttrib(GL_CURRENT_BIT);
+
+	glColor3f(1.0f, 0.0f, 0.0f);
+	
+	gluSphere((::GLUquadric *)mSphere,
+		2e-3f * Magnitude(mBvh->GetBox().Size()), 6, 6);
+
+	glPopAttrib();
+	glPopMatrix();
+}
+
+}
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.cpp	(revision 2786)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.cpp	(revision 2788)
@@ -222,5 +222,5 @@
 	if (mUseRenderQueue && (mRenderState->GetMode() == RenderState::RENDER))
 	{
-		//cout << "render queue: " << mRenderQueue.GetSize() << endl;
+		//Debug << "render queue: " << mRenderQueue.GetSize() << endl;
 		mRenderQueue.Render();
 		mRenderQueue.Clear();
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2787)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2788)
@@ -57,6 +57,4 @@
 float winAspectRatio = 1.0f;
 
-float visZoomFactor = 1.5f;
-
 double accumulatedTime = 1000;
 float fps = 1e3f;
@@ -137,5 +135,5 @@
 
 
-	camera = new Camera(winWidth, winHeight);
+	camera = new Camera(winWidth, winHeight, 60);
 	camera->SetNear(nearDist);
 
@@ -267,7 +265,5 @@
 		"'V'            - shows/hides bounding volumes",
 		"",
-		"'1'            - shows/hides visualization",
-		"'2'            - zooms out visualization",
-		"'3'            - zooms in visualization",
+		"'1'            - shows/hides bird eye view",
 		0,
 	};
@@ -480,11 +476,4 @@
 		visMode = !visMode;
 		break;
-	case '2':
-		visZoomFactor += 0.1;	
-		break;
-	case '3':
-		visZoomFactor -= 0.1;
-		if (visZoomFactor < 0.1) visZoomFactor = 0.1;
-		break;
 	case '8':
 		{
@@ -630,4 +619,5 @@
 
 	gluPerspective(60.0f, 1.0f / winAspectRatio, nearDist, 2.0f * Magnitude(bvh->GetBox().Diagonal()));
+
 	glMatrixMode(GL_MODELVIEW);
 
@@ -817,28 +807,35 @@
 	glColor4f(0.0,0.0,0.0,0.5); 
 
-	glRecti(winWidth, 0, winWidth / 2, winHeight / 2);
+	glRecti(winWidth, 0, winWidth - winWidth / 4, winHeight / 3);
 	glDisable(GL_BLEND);
 	end2D();
-
-	glViewport(winWidth / 2, winHeight / 2, winWidth, winHeight);
+	
+	glViewport(winWidth - winWidth / 4, winHeight - winHeight / 3, winWidth, winHeight);
+
+
+	glMatrixMode(GL_PROJECTION);
+	glLoadIdentity();
+	
+	//gluPerspective(60.0f, 1.0f / winAspectRatio, nearDist, 2.0f * Magnitude(bvh->GetBox().Diagonal()));
+	AxisAlignedBox3 box = bvh->GetBox();
+	const float offs = 2000;
+	glOrtho(box.Min().y - offs, box.Max().y + offs, box.Min().y - offs, box.Max().y + offs, 0.1, 20.0f * Magnitude(bvh->GetBox().Diagonal())); 
+	
+	
 	glPushMatrix();
-	//glMatrixMode(GL_PROJECTION);
+
 	glMatrixMode(GL_MODELVIEW);
 	glLoadIdentity();
 
-	Vector3 pos(camera->GetPosition());
-    pos.z = 10.0f * bvh->GetBox().Size().z;
-	pos.y = 800;
-	pos.x += 1000;
-
-	Matrix4x4 m = RotationZMatrix(-rotation);
-	Matrix4x4 t = TranslationMatrix(pos);
-	Matrix4x4 minust = TranslationMatrix(-pos);
-
 	glMultMatrixf((float *)visView.x);
 
-	glMultMatrixf((float *)t.x);
-	glMultMatrixf((float *)m.x);
-	glMultMatrixf((float *)minust.x);
+	//SetupLighting();
+	GLfloat position[] = {0.8f, 1.0f, 1.5f, 0.0f};
+	glLightfv(GL_LIGHT0, GL_POSITION, position);
+
+	GLfloat position1[] = {bvh->GetBox().Center().x, bvh->GetBox().Max().y, bvh->GetBox().Center().z, 1.0f};
+	glLightfv(GL_LIGHT1, GL_POSITION, position1);
+
+
 
 	glClear(GL_DEPTH_BUFFER_BIT);
@@ -847,5 +844,4 @@
 	//-- visualization of the occlusion culling
 
-	//traverser->RenderScene();
 	visualization->Render();
 	
@@ -856,17 +852,16 @@
 
 
-/** Sets up view matrix in order to get a good position 
-	for viewing the kd tree node culling
+/** Sets up view matrix for bird eye view
 */
 void setupVisView()
 {
-	Vector3 pos(-camera->GetPosition());
-    pos.z = -10.0f * bvh->GetBox().Size().z;
-	pos.y += 800;
-	pos.x -= 1000;
+	Vector3 pos(-bvh->GetBox().Center());
+ 
+	pos.z = -15.0f * bvh->GetBox().Size().z;
+	pos.y += 1400;
+	pos.x -= 1170;
 
 	Vector3 dir(0, 0, 1);
 	Vector3 up(0, 1, 0);
-	//Vector3 up(camera->GetDirection());up.y = 0;
 
 	Vector3 left = Normalize(CrossProd(dir, up));
@@ -879,4 +874,6 @@
 	visView.x[3][1] = pos.y;
 	visView.x[3][2] = pos.z;
+
+	//cout << visView<< endl;
 }
 
@@ -929,4 +926,5 @@
 	char msg4[200];
 	char msg5[200];
+	char msg6[200];
 
 
@@ -965,8 +963,10 @@
 			  renderedNodes, bvh->GetNumVirtualNodes(), str.c_str(), str2.c_str()); 
 
-	sprintf_s(msg4, "traversed: %5d, frustum culled: %5d, query culled: %5d, issued queries: %5d, state changes: %5d",
-			  traversedNodes, frustumCulledNodes, queryCulledNodes, issuedQueries, stateChanges);
-
-	sprintf_s(msg5, "fps: %6.1f", fps);
+	sprintf_s(msg4, "traversed: %5d, frustum culled: %5d, query culled: %5d",
+			  traversedNodes, frustumCulledNodes, queryCulledNodes);
+
+	sprintf_s(msg5, "issued queries: %5d, state changes: %5d", issuedQueries, stateChanges);
+
+	sprintf_s(msg6, "fps: %6.1f", fps);
 	//cout << "previously visible node queries: " << traverser->GetStats().mNumPreviouslyVisibleNodeQueries << endl;
 
@@ -988,4 +988,5 @@
 			Output(20, 90, msg4);
 			Output(20, 120, msg5);
+			Output(20, 150, msg6);
 		}
 	}
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Visualization.h
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Visualization.h	(revision 2787)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Visualization.h	(revision 2788)
@@ -52,4 +52,5 @@
 	void RenderBox(const AxisAlignedBox3 &box);
 
+	void RenderViewPoint();
 
 
