Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Geometry.h
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Geometry.h	(revision 2842)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Geometry.h	(revision 2951)
@@ -20,4 +20,6 @@
 public:
 	/** Constructor taking an array of triangles.
+		If delData is true, the vertex / normal / texture is deleted when
+		after it was transferred into a vbo
 	*/
 	Geometry(Vector3 *vertices, 
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.cpp	(revision 2947)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.cpp	(revision 2951)
@@ -120,6 +120,5 @@
 
 			// store the visible entities for rendering in the second pass
-			if (mUseDepthPass)
-				mVisibleObjects.push_back(ent);
+			if (mUseDepthPass) mVisibleObjects.push_back(ent);
 		}
 
@@ -148,9 +147,8 @@
 {
 	mVisibleObjects.clear();
+	mMaxVisibleDistance = .0f;
 
 	glEnableClientState(GL_VERTEX_ARRAY);
-	
-	if (!mUseDepthPass)
-		glEnableClientState(GL_NORMAL_ARRAY);
+	if (!mUseDepthPass) glEnableClientState(GL_NORMAL_ARRAY);
 
 	++ mFrameId;
@@ -160,5 +158,5 @@
 	mStats.Reset();
 	mQueryHandler.ResetQueries();
-	
+	// add root node to queue
 	EnqueueNode(mBvh->GetRoot());
 
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/MotionPath.h
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/MotionPath.h	(revision 2951)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/MotionPath.h	(revision 2951)
@@ -0,0 +1,49 @@
+#ifndef __MOTIONPATH_H
+#define __MOTIONPATH_H
+
+
+#include "common.h"
+#include "Vector3.h"
+
+
+namespace CHCDemoEngine 
+{
+
+
+/** Represents a vertex track for animation
+*/
+class MotionPath
+{
+public:
+
+	/** Constructor for a vertex path. The first vertex
+		is also the starting point of the motion
+	*/
+	MotionPath(const VertexArray &vertices);
+	/** Moves forward using the given velocity
+	*/
+	void Move(float velocity);
+	/** Gets current position on track.
+	*/
+	Vector3 GetCurrentPosition() const;
+	/** Gets the current direction direction.
+	*/
+	Vector3 GetCurrentDirection() const;
+	/** Resets the track to the starting position
+	*/
+	void Reset();
+
+
+protected:
+	
+	VertexArray mVertices;
+	/// current position between two verticess curve paramter
+	float mT;
+	/// the current vertex position
+	int mCurrentVertexIdx;
+};
+
+
+}
+
+#endif // __MOTIONPATH_H
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/AxisAlignedBox3.h
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/AxisAlignedBox3.h	(revision 2947)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/AxisAlignedBox3.h	(revision 2951)
@@ -149,10 +149,10 @@
 
 	// Six faces are distuinguished by their name.
-	enum EFaces {ID_Back = 0, 
-		ID_Left = 1, 
-		ID_Bottom = 2, 
-		ID_Front = 3,
-		ID_Right = 4, 
-		ID_Top = 5};
+	enum EFaces {ID_Back = 0,
+				 ID_Left = 1, 
+				 ID_Bottom = 2, 
+				 ID_Front = 3,
+				 ID_Right = 4, 
+				 ID_Top = 5};
 
 	// Writes a brief description of the object, indenting by the given
@@ -217,4 +217,8 @@
 	*/
 	void ExtractPolygons(PolygonContainer &polys) const;
+	/** Returns triangle representation of this box.
+	*/
+	void Triangulate(std::vector<Triangle3> &triangles) const;
+
 
 
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg	(revision 2949)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg	(revision 2951)
@@ -34,5 +34,4 @@
 
 	float4 mypos: TEXCOORD3;
-	//float DEPTH;
 };
 
@@ -45,4 +44,5 @@
 };
 
+#pragma position_invariant vtx
 
 vtxout vtx(vtxin IN, 
@@ -59,9 +59,11 @@
 
    // transform the vertex position into eye space
-   OUT.position = mul(ModelViewProj, OUT.worldPos);
+   //OUT.position = mul(ModelViewProj, OUT.worldPos);
+   OUT.position = mul(glstate.matrix.mvp, IN.position);
 
    OUT.normal = IN.normal;
 
    OUT.mypos = OUT.position;
+
    return OUT;
 }
@@ -79,8 +81,7 @@
 	pix.col = (ambient + diffuse) * tex2D(tex, IN.texCoord.xy);
 	
-	// save world position in second rt
+	// save world position in second render target
 	pix.pos = IN.worldPos * maxDepth;
 	// save normal in third rt
-	//pix.norm.xyz = IN.normal * 0.5f + 0.5f;
 	pix.norm.xyz = IN.normal;
 
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntityConverter.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntityConverter.cpp	(revision 2946)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntityConverter.cpp	(revision 2951)
@@ -1,3 +1,6 @@
 #include "SceneEntityConverter.h"
+#include "SceneEntity.h"
+#include "Geometry.h"
+#include "Shape.h"
 
 
@@ -7,3 +10,42 @@
 namespace CHCDemoEngine 
 {
+
+SceneEntity *SceneEntityConverter::ConvertBox(const AxisAlignedBox3 &box, 
+											  Material *mat, 
+											  Transform3 *trafo)
+{
+	SceneEntity *ent = new SceneEntity(trafo);
+
+	vector<Triangle3> triangles;
+
+	box.Triangulate(triangles);
+
+	Vector3 *vertices = new Vector3[12];
+	Vector3 *normals = new Vector3[12];
+
+	for (size_t i = 0; i < triangles.size(); ++ i)
+	{
+		Triangle3 tri = triangles[i];
+
+		vertices[i * 3 + 0] = tri.mVertices[0];
+		vertices[i * 3 + 1] = tri.mVertices[1];
+		vertices[i * 3 + 2] = tri.mVertices[2];
+
+		Vector3 normal = tri.GetNormal();
+
+		normals[i * 3 + 0] = normal;
+		normals[i * 3 + 1] = normal;
+		normals[i * 3 + 2] = normal;
+	}
+
+
+	Geometry *geom = new Geometry(vertices, normals, NULL, 12, true);
+
+	Shape *shape = new Shape(geom, mat, ent);
+	ent->AddShape(shape);
+
+	return ent;
 }
+
+
+}
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.h
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.h	(revision 2947)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.h	(revision 2951)
@@ -492,5 +492,5 @@
 	/** Returns geometry by reference (faster).
 	*/
-	SceneEntity **GetGeometry(BvhNode *node, int &size);
+	SceneEntity **GetGeometry(BvhNode *node, int &size) const;
 
 
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.cpp	(revision 2947)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.cpp	(revision 2951)
@@ -290,5 +290,5 @@
 		}
 		else
-		{
+		{ 
 			BvhInterior *interior = static_cast<BvhInterior *>(node);
 
@@ -300,5 +300,5 @@
 
 
-SceneEntity **Bvh::GetGeometry(BvhNode *node, int &geometrySize)
+SceneEntity **Bvh::GetGeometry(BvhNode *node, int &geometrySize) const
 {
 	geometrySize = node->CountPrimitives();
@@ -398,4 +398,19 @@
 {
 	return node->GetBox().GetMaxDistance(sNearPlane);
+
+	float maxDist = .0f;
+
+	int geometrySize;
+	SceneEntity **entities = GetGeometry(node, geometrySize);
+
+	for (int i = 0; i < geometrySize; ++ i)
+	{
+		SceneEntity *ent = entities[i];
+		float dist = ent->GetTransformedBoundingBox().GetMaxDistance(sNearPlane);
+
+		if (dist > maxDist) maxDist = dist;
+	}
+
+	return maxDist;
 }
 
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Transform3.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Transform3.cpp	(revision 2950)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Transform3.cpp	(revision 2951)
@@ -28,9 +28,9 @@
 		cgGLSetMatrixParameterfc(sModelMatrixParam, (const float *)mMatrix->x);
 	}
-	else
-	{
+//	else
+//	{
 		glPushMatrix();
 		glMultMatrixf((float *)mMatrix->x);
-	}
+//	}
 }
 
@@ -45,8 +45,8 @@
 		cgGLSetMatrixParameterfc(sModelMatrixParam, (const float *)identity.x);
 	}
-	else
-	{
+//	else
+//	{
 		glPopMatrix();
-	}
+//	}
 }
 
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.cpp	(revision 2947)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.cpp	(revision 2951)
@@ -590,5 +590,4 @@
 
 	glDisable(GL_LIGHTING);
-	//glDisable(GL_TEXTURE_2D);
 	glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
 
@@ -658,5 +657,4 @@
 {
 	const Vector3 dir = mLight->GetDirection();
-	//const Vector3 dir(0, 0, -1);
 
 	mShadowCam->SetDirection(dir);
@@ -692,7 +690,5 @@
 	glMatrixMode(GL_MODELVIEW);
 	glPushMatrix();
-	glLoadIdentity();
-
-	//glDisable(GL_CULL_FACE);
+	
 	mShadowCam->SetupCameraView();
 
@@ -704,10 +700,11 @@
 
 
+
+	glMatrixMode(GL_PROJECTION);
+	glPopMatrix();
+
 	glMatrixMode(GL_MODELVIEW);
 	glPopMatrix();
 
-	glMatrixMode(GL_PROJECTION);
-	glPopMatrix();
-
 	
 	glDisable(GL_POLYGON_OFFSET_FILL);
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2950)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2951)
@@ -228,8 +228,8 @@
 inline float KeyRotationAngle() { return keyRotation * elapsedTime * 1e-3f; }
 inline float KeyShift() { return keyForwardMotion * elapsedTime * 1e-3f; }
+
 void InitFBO();
-void RenderShadowMap();
-
-
+
+void RenderShadowMap(float newfar);
 
 
@@ -516,5 +516,4 @@
 
 		cgGLSetParameter1f(sMaxDepthParamTex, MAX_DEPTH_CONST / farDist);
-		//Debug << "maxdepth: " << MAX_DEPTH_CONST / myfar << endl;
 	}
 	else
@@ -557,13 +556,12 @@
 
 	// the diffuse color buffer
-	//fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_MIPMAP_LINEAR, true);
-	fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, false);
+	fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_MIPMAP_LINEAR, true);
+	//fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, false);
 
 	// the positions buffer
 	fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_MIPMAP_LINEAR, true);
 	//fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, false);
-	
+
 	// the normals buffer
-	//fbo->AddColorBuffer(ColorBufferObject::BUFFER_UBYTE, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, false);
 	fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, false);
 
@@ -592,5 +590,5 @@
 void InitGLstate() 
 {
-	glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+	glClearColor(0.2f, 0.2f, 0.8f, 1.0f);
 	
 	glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
@@ -608,7 +606,6 @@
 	glEnable(GL_NORMALIZE);
 		
-	//glEnable(GL_ALPHA_TEST);
 	glDisable(GL_ALPHA_TEST);
-	glAlphaFunc(GL_GEQUAL, 0.8f);
+	glAlphaFunc(GL_GEQUAL, 0.5f);
 
 	glFrontFace(GL_CCW);
@@ -616,5 +613,4 @@
 	glEnable(GL_CULL_FACE);
 
-	//glDisable(GL_CULL_FACE);
 	glDisable(GL_TEXTURE_2D);
 
@@ -810,6 +806,5 @@
 
 	glMatrixMode(GL_MODELVIEW);
-	glLoadIdentity();
-
+	
 	// set up the camera view
 	camera->SetupCameraView();
@@ -877,4 +872,6 @@
 	cgGLEnableProfile(RenderState::sCgFragmentProfile);
 	cgGLBindProgram(RenderState::sCgMrtFragmentProgram);
+
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 }
 
@@ -919,4 +916,8 @@
 	}
 
+	
+	// bring eye modelview matrix up-to-date
+	SetupEyeView();
+
 	// hack
 	int oldRenderType = renderType;
@@ -957,6 +958,5 @@
 		cgGLDisableProfile(RenderState::sCgVertexProfile);
 
-		glClear(GL_DEPTH_BUFFER_BIT);
-		//glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
 		// the scene is rendered withouth any shading	
@@ -988,14 +988,13 @@
 
 		if (showShadowMap && !renderLightView)
-			RenderShadowMap();
-		
+			RenderShadowMap(camera->GetFar());
+
 		//glPushAttrib(GL_VIEWPORT_BIT);
 		glViewport(0, 0, texWidth, texHeight);
 
 		InitDeferredRendering();
+		
 		// draw to 3 color buffers
 		glDrawBuffers(3, mrt);
-
-		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
 		break;
@@ -1011,8 +1010,4 @@
 	// reset lod levels for current frame
 	LODLevel::InitFrame(camera->GetPosition());
-
-
-	// bring eye modelview matrix up-to-date
-	SetupEyeView();
 
 	// set up lights
@@ -1362,11 +1357,9 @@
 
 		renderType = (renderType + 1) % RenderState::NUM_RENDER_TYPES;
-		traverser->SetUseDepthPass((renderType == RenderState::DEPTH_PASS) || (renderType == RenderState::DEPTH_PASS) || (renderType == RenderState::DEPTH_PASS_DEFERRED));
+		traverser->SetUseDepthPass((renderType == RenderState::DEPTH_PASS) || (renderType == RenderState::DEPTH_PASS_DEFERRED));
 		
 		break;
 	case GLUT_KEY_F8:
-
 		useAdvancedShading = !useAdvancedShading;
-		//shadingMethod = (DeferredRenderer::SHADING_METHOD)((shadingMethod + 1) % 2);
 
 		break;
@@ -1899,12 +1892,20 @@
 	{
 		if (showShadowMap && !renderLightView)
-			RenderShadowMap();
+		{
+			float minVisibleDist = min(camera->GetFar(), traverser->GetMaxVisibleDistance());
+			RenderShadowMap(minVisibleDist);
+			//cout << "far: " << camera->GetFar() << " min: " << traverser->GetMaxVisibleDistance() << endl;
+		}
+		glEnableClientState(GL_VERTEX_ARRAY);
+		glEnableClientState(GL_NORMAL_ARRAY);
 
 		glDisable(GL_LIGHTING);
 		glViewport(0, 0, texWidth, texHeight);
+
 		InitDeferredRendering();
 
 		// draw to 3 color buffers
 		glDrawBuffers(3, mrt);
+		glClear(GL_COLOR_BUFFER_BIT);
 	}
 	else
@@ -1912,4 +1913,5 @@
 		glShadeModel(GL_SMOOTH);
 		glEnable(GL_LIGHTING);
+
 		state.SetRenderType(RenderState::FIXED);
 	}
@@ -1921,6 +1923,5 @@
 	state.SetUseAlphaToCoverage(true);
 	state.Reset();
-	
-	
+
 	//cout << "visible: " << (int)traverser->GetVisibleObjects().size() << endl;
 
@@ -1936,5 +1937,4 @@
 
 	glDepthFunc(GL_LESS);
-	state.SetUseAlphaToCoverage(true);
 
 	PrintGLerror("visibleobjects");
@@ -1956,5 +1956,5 @@
 
 
-void RenderShadowMap()
+void RenderShadowMap(float newfar)
 {
 	cgGLDisableProfile(RenderState::sCgFragmentProfile);
@@ -1969,5 +1969,5 @@
 
 	// hack: temporarily change camera far plane
-	//camera->SetFar(0.2f * Magnitude(bvh->GetBox().Diagonal()));
+	camera->SetFar(newfar);
 
 	// the scene is rendered withouth any shading	
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.h
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.h	(revision 2947)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.h	(revision 2951)
@@ -190,5 +190,4 @@
 	/// the objects found visible in current frame
 	SceneEntityContainer mVisibleObjects;
-
 	/// the maximal visible distance in the scene
 	float mMaxVisibleDistance;
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/MotionPath.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/MotionPath.cpp	(revision 2951)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/MotionPath.cpp	(revision 2951)
@@ -0,0 +1,35 @@
+#include "MotionPath.h"
+
+
+namespace CHCDemoEngine 
+{
+
+
+MotionPath::MotionPath(const VertexArray &vertices):
+mVertices(vertices), mCurrentVertexIdx(0)
+{
+}
+
+
+void MotionPath::Move(float velocity)
+{
+}
+
+
+Vector3 MotionPath::GetCurrentPosition() const
+{
+}
+
+
+Vector3 MotionPath::GetCurrentDirection() const
+{
+}
+
+
+void MotionPath::Reset()
+{
+	mCurrentVertexIdx = 0;
+}
+
+
+}
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/AxisAlignedBox3.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/AxisAlignedBox3.cpp	(revision 2947)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/AxisAlignedBox3.cpp	(revision 2951)
@@ -3,4 +3,5 @@
 #include "Polygon3.h"
 #include "Polyhedron.h"
+#include "Triangle3.h"
 
 #include <cassert>
@@ -1400,4 +1401,97 @@
 }
 
-}
-
+
+void AxisAlignedBox3::Triangulate(std::vector<Triangle3> &triangles) const
+{
+	Triangle3 tri;
+
+	tri.mVertices[0] = Vector3(mMin.x, mMax.y ,mMin.z);
+	tri.mVertices[1] = Vector3(mMin.x, mMax.y, mMax.z);
+	tri.mVertices[2] = Vector3(mMin.x, mMin.y, mMax.z);
+
+	triangles.push_back(tri);
+
+    tri.mVertices[0] = Vector3(mMin.x, mMin.y, mMax.z);
+	tri.mVertices[1] = Vector3(mMin.x, mMin.y, mMin.z);
+	tri.mVertices[2] = Vector3(mMin.x, mMax.y ,mMin.z);
+
+	triangles.push_back(tri);
+
+	//////////////////////////////////////
+
+    tri.mVertices[0] = Vector3(mMax.x, mMax.y, mMax.z);
+    tri.mVertices[1] = Vector3(mMax.x, mMax.y, mMin.z);
+	tri.mVertices[2] = Vector3(mMax.x, mMin.y, mMin.z);
+
+	triangles.push_back(tri);
+
+	tri.mVertices[0] = Vector3(mMax.x, mMin.y, mMin.z);
+	tri.mVertices[1] = Vector3(mMax.x, mMin.y, mMax.z);
+    tri.mVertices[2] = Vector3(mMax.x, mMax.y, mMax.z);
+
+	triangles.push_back(tri);
+
+
+	//////////////////////////////////////
+
+	tri.mVertices[0] = Vector3(mMin.x, mMin.y, mMax.z);
+	tri.mVertices[1] = Vector3(mMax.x, mMin.y, mMax.z);
+    tri.mVertices[2] = Vector3(mMax.x, mMin.y ,mMin.z);
+
+	triangles.push_back(tri);
+
+    tri.mVertices[0] = Vector3(mMax.x, mMin.y ,mMin.z);
+	tri.mVertices[1] = Vector3(mMin.x, mMin.y, mMin.z);
+	tri.mVertices[2] = Vector3(mMin.x, mMin.y, mMax.z);	
+
+	triangles.push_back(tri);
+
+
+	//////////////////////////////////////
+
+	tri.mVertices[0] = Vector3(mMax.x, mMax.y, mMax.z);
+	tri.mVertices[1] = Vector3(mMin.x, mMax.y, mMax.z);
+	tri.mVertices[2] = Vector3(mMin.x, mMax.y, mMin.z);
+
+	triangles.push_back(tri);
+
+	tri.mVertices[0] = Vector3(mMin.x, mMax.y, mMin.z);
+	tri.mVertices[1] = Vector3(mMax.x, mMax.y, mMin.z);
+	tri.mVertices[2] = Vector3(mMax.x, mMax.y, mMax.z);
+    
+	triangles.push_back(tri);
+
+
+	//////////////////////////////////////
+
+    tri.mVertices[0] = Vector3(mMax.x, mMin.y, mMin.z);
+	tri.mVertices[1] = Vector3(mMax.x, mMax.y, mMin.z);
+	tri.mVertices[2] = Vector3(mMin.x, mMax.y, mMin.z);
+	   
+	triangles.push_back(tri);
+
+	tri.mVertices[0] = Vector3(mMin.x, mMax.y, mMin.z);
+	tri.mVertices[1] = Vector3(mMin.x, mMin.y, mMin.z);
+    tri.mVertices[2] = Vector3(mMax.x, mMin.y, mMin.z);
+	   
+	triangles.push_back(tri);
+
+
+	//////////////////////////////////////
+
+    tri.mVertices[0] = Vector3(mMax.x, mMax.y, mMax.z);
+	tri.mVertices[1] = Vector3(mMax.x, mMin.y, mMax.z);
+    tri.mVertices[2] = Vector3(mMin.x, mMin.y, mMax.z);
+
+	triangles.push_back(tri);
+
+    tri.mVertices[0] = Vector3(mMin.x, mMin.y, mMax.z);
+    tri.mVertices[1] = Vector3(mMin.x, mMax.y, mMax.z);
+    tri.mVertices[2] = Vector3(mMax.x, mMax.y, mMax.z);
+	   
+	triangles.push_back(tri);
+}
+
+
+}
+
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/FriendlyCulling.vcproj
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/FriendlyCulling.vcproj	(revision 2946)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/FriendlyCulling.vcproj	(revision 2951)
@@ -268,4 +268,12 @@
 			</File>
 			<File
+				RelativePath=".\src\MotionPath.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\src\MotionPath.h"
+				>
+			</File>
+			<File
 				RelativePath=".\src\PerformanceGraph.cpp"
 				>
