Index: /experimental/distortionNG/distortionNG.cpp
===================================================================
--- /experimental/distortionNG/distortionNG.cpp	(revision 328)
+++ /experimental/distortionNG/distortionNG.cpp	(revision 329)
@@ -27,5 +27,5 @@
 	_highlighter->setUseDisplayList( false );
 	_highlighter->setUseVertexBufferObjects( true );
-	_highlighter->setVertexArray( new osg::Vec3Array(1) );
+	_highlighter->setVertexArray( new osg::Vec3Array(1) );	// The highlighter vertex is updated by computeSelectedVertex(..)
 	_highlighter->setColorArray( colors.get() );
 	_highlighter->setColorBinding( osg::Geometry::BIND_OVERALL );
@@ -54,5 +54,6 @@
 			osg::ref_ptr<osgUtil::LineSegmentIntersector> intersector = new osgUtil::LineSegmentIntersector(osgUtil::Intersector::WINDOW, ea.getX(), ea.getY());
 			osgUtil::IntersectionVisitor iv( intersector.get() );
-			viewer->getCamera()->accept( iv );
+			//viewer->getCamera()->accept( iv );
+			_camera->accept( iv );
 	        
 			if ( intersector->containsIntersections() )
@@ -93,13 +94,16 @@
 	if ( !vertices || !selVertices )
 		return;
+	
+	OSG_NOTIFY(osg::ALWAYS)<<"size of vertices="<<vertices->size()<<std::endl;
+	OSG_NOTIFY(osg::ALWAYS)<<"size of selVertices="<<selVertices->size()<<std::endl;
 
 	osg::Vec3 point = result.getWorldIntersectPoint();
 	osg::Matrix matrix = osg::computeLocalToWorld( result.nodePath );	// To compute the intersection vertices in world coordinates not in model coordinates
-	//std::cout << "Intersection-indices: Size=" << result.indexList.size() << std::endl;
+	OSG_NOTIFY(osg::ALWAYS) << "Intersection-indices: Size=" << result.indexList.size() << std::endl;
 	const std::vector<unsigned int>& selIndices = result.indexList;
 	{
 		double maxRatio = 0.0;
 		int closestVertexIndex = 0;
-		for ( unsigned int i=0; i<3 && i<result.ratioList.size(); i++ )	//iterate through rations and search for max
+		for ( unsigned int i=0; i<3 && i<result.ratioList.size(); i++ )	//iterate through rations and search for maxRation=nearestVertex
 		{
 			if(result.ratioList[i] > maxRatio)
@@ -108,9 +112,13 @@
 				closestVertexIndex = result.indexList[i];
 			}
+			OSG_NOTIFY(osg::ALWAYS)<<"maxRatio="<<maxRatio<<std::endl;
+			OSG_NOTIFY(osg::ALWAYS)<<"closestVertexIndex="<<closestVertexIndex<<std::endl;
 		}
+		OSG_NOTIFY(osg::ALWAYS)<<"nearest vertex: X="<<(*vertices)[closestVertexIndex].x()<<" Y="<<(*vertices)[closestVertexIndex].y()<<" Z="<<(*vertices)[closestVertexIndex].z()<<std::endl;
 		osg::Vec3 vertex = (*vertices)[closestVertexIndex] * matrix;
-		selVertices->front() = vertex;
+
+		selVertices->front() = vertex;		
+		OSG_NOTIFY(osg::ALWAYS)<<"selected vertice: X="<<vertex.x()<<" Y="<<vertex.y()<<" Z="<<vertex.z()<<std::endl;
 	}
-
 	selVertices->dirty();
 	_highlighter->dirtyBound(); 
Index: /experimental/distortionNG/distortionNG.h
===================================================================
--- /experimental/distortionNG/distortionNG.h	(revision 328)
+++ /experimental/distortionNG/distortionNG.h	(revision 329)
@@ -16,6 +16,6 @@
 
 public:
-	distortionHandler( osg::Camera* camera )
-    : _highlighter(0), _camera(camera), _highlightColor( osg::Vec4(1.0f, 1.0f, 0.0f, 1.0f) ) {}
+	distortionHandler( osg::Camera* camera, osg::Geometry* distortionMesh )
+    : _highlighter(0), _camera(camera), _distortionMesh(distortionMesh), _highlightColor( osg::Vec4(1.0f, 1.0f, 0.0f, 1.0f) ) {}
 
     void computeSelectedVertex( osgUtil::LineSegmentIntersector::Intersection& result );
@@ -27,4 +27,5 @@
 	osg::ref_ptr<osg::Geometry> _highlighter;
     osg::observer_ptr<osg::Camera> _camera;
+	osg::Geometry* _distortionMesh;
 	const osg::Vec4 _highlightColor;
 };
Index: /experimental/distortionNG/extViewer.cpp
===================================================================
--- /experimental/distortionNG/extViewer.cpp	(revision 328)
+++ /experimental/distortionNG/extViewer.cpp	(revision 329)
@@ -1,4 +1,6 @@
 #include "extViewer.h"
-
+#include "distortionNG.h"
+
+#include <osg/PolygonOffset>
 #include<osg/Texture2D>
 #include<osg/TextureRectangle>
@@ -131,5 +133,6 @@
         osg::Geode* geode = new osg::Geode();
 		//geode->addDrawable(createParoramicSphericalDisplayDistortionMesh(osg::Vec3(0.0f,0.0f,0.0f), osg::Vec3(width,0.0f,0.0f), osg::Vec3(0.0f,height,0.0f), 1, 0.45, 0, projectorMatrix));
-		geode->addDrawable(createMesh(osg::Vec3(0.0f,0.0f,0.0f), osg::Vec3(width,0.0f,0.0f), osg::Vec3(0.0f,height,0.0f), 20, 20, projectorMatrix));
+		osg::Geometry* distortionMesh = createMesh(osg::Vec3(0.0f,0.0f,0.0f), osg::Vec3(width,0.0f,0.0f), osg::Vec3(0.0f,height,0.0f), 20, 20, projectorMatrix);
+		geode->addDrawable(distortionMesh);
 
         // new we need to add the texture to the mesh, we do so by creating a
@@ -165,5 +168,19 @@
 
         // add subgraph to render
-        camera->addChild(geode);
+        //camera->addChild(geode);
+
+		// selector
+		geode->getOrCreateStateSet()->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
+		geode->getOrCreateStateSet()->setAttributeAndModes( new osg::PolygonOffset(1.0f, 1.0f) );
+		osg::ref_ptr<distortionHandler> selector = new distortionHandler( camera, distortionMesh );
+		osg::ref_ptr<osg::Group> root = new osg::Group;
+		root->addChild(geode);
+		root->addChild(selector->createVertexHighlighter());
+		addEventHandler( selector.get() );
+		camera->addChild(root);
+		// Avoid that the highlighter is culled away
+		osg::CullSettings::CullingMode mode = camera->getCullingMode();
+		camera->setCullingMode( mode & (~osg::CullSettings::SMALL_FEATURE_CULLING) );
+
 
         camera->setName("Dist Cam");
Index: /experimental/distortionNG/main.cpp
===================================================================
--- /experimental/distortionNG/main.cpp	(revision 328)
+++ /experimental/distortionNG/main.cpp	(revision 329)
@@ -119,9 +119,8 @@
 	//root->addChild( geode.get() );
 	//root->addChild( selector->createVertexHighlighter() );
-
 	//viewer.addEventHandler( selector.get() );
 	//viewer.setSceneData( root.get() );
 
-	//// Avoid that the highlighter is culled away
+	// Avoid that the highlighter is culled away
 	//osg::CullSettings::CullingMode mode = viewer.getCamera()->getCullingMode();
 	//viewer.getCamera()->setCullingMode( mode & (~osg::CullSettings::SMALL_FEATURE_CULLING) );
@@ -130,2 +129,15 @@
 	return viewer.run();
 }
+
+/*
+ToDo: 
+ * 
+ * distortionHandler::handle startet Intersections. Da jedoch das distortion Mesh keine Geometry der Scene mehr ist, gibt es keine Intersection
+ *  -> es muss die intersektion umgestellt werden, um das Distortion Mesh zu intersecten.
+ * Es muss geprüft werdne, ob bei dne Mausverschiebungen die texturecoordinaten verschoben, oder das Distortion Mesh verschoben wird.
+
+
+
+
+
+*/
