Index: orxonox/branches/shadows/src/Makefile.in
===================================================================
--- orxonox/branches/shadows/src/Makefile.in	(revision 3712)
+++ orxonox/branches/shadows/src/Makefile.in	(revision 3728)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.8.5 from Makefile.am.
+# Makefile.in generated by automake 1.8.3 from Makefile.am.
 # @configure_input@
 
@@ -572,14 +572,12 @@
 	tags=; \
 	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	if (etags --etags-include --version) >/dev/null 2>&1; then \
 	  include_option=--etags-include; \
-	  empty_fix=.; \
 	else \
 	  include_option=--include; \
-	  empty_fix=; \
 	fi; \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
+	    test -f $$subdir/TAGS && \
 	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
@@ -591,9 +589,7 @@
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
-	fi
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
 ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
Index: orxonox/branches/shadows/src/console/Makefile.in
===================================================================
--- orxonox/branches/shadows/src/console/Makefile.in	(revision 3712)
+++ orxonox/branches/shadows/src/console/Makefile.in	(revision 3728)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.8.5 from Makefile.am.
+# Makefile.in generated by automake 1.8.3 from Makefile.am.
 # @configure_input@
 
@@ -289,9 +289,7 @@
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
-	fi
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
Index: orxonox/branches/shadows/src/gui/Makefile.in
===================================================================
--- orxonox/branches/shadows/src/gui/Makefile.in	(revision 3712)
+++ orxonox/branches/shadows/src/gui/Makefile.in	(revision 3728)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.8.5 from Makefile.am.
+# Makefile.in generated by automake 1.8.3 from Makefile.am.
 # @configure_input@
 
@@ -321,9 +321,7 @@
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
-	fi
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
Index: orxonox/branches/shadows/src/importer/Makefile.in
===================================================================
--- orxonox/branches/shadows/src/importer/Makefile.in	(revision 3712)
+++ orxonox/branches/shadows/src/importer/Makefile.in	(revision 3728)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.8.5 from Makefile.am.
+# Makefile.in generated by automake 1.8.3 from Makefile.am.
 # @configure_input@
 
@@ -306,9 +306,7 @@
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
-	fi
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
Index: orxonox/branches/shadows/src/orxonox.cc
===================================================================
--- orxonox/branches/shadows/src/orxonox.cc	(revision 3712)
+++ orxonox/branches/shadows/src/orxonox.cc	(revision 3728)
@@ -133,6 +133,6 @@
 
   int bpp = 16;
-  int width = 1024;
-  int height = 768;
+  int width = 400;
+  int height = 300;
   //Uint32 flags = SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER; /* \todo: SDL_OPENGL doen't permit to load images*/
   //Uint32 flags = SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER;
Index: orxonox/branches/shadows/src/shadow.cc
===================================================================
--- orxonox/branches/shadows/src/shadow.cc	(revision 3712)
+++ orxonox/branches/shadows/src/shadow.cc	(revision 3728)
@@ -29,4 +29,6 @@
 #include <math.h>
 #include "shadow.h"
+#include "vector.h"
+
 
 #define SIZE 	128
@@ -39,5 +41,5 @@
 */
 
-Shadow::Shadow(OBJModel* player,Player* playerangle,float groundVertexes[])
+Shadow::Shadow(OBJModel* player,Player* playerangle)
 {
     this->player=player;
@@ -101,6 +103,6 @@
 void Shadow::createShadow()
 {
-    glViewport(0,0,2*SIZE,2*SIZE);
-    glScissor(0,0,2*SIZE,2*SIZE);
+    glViewport(0,0,SIZE,SIZE);
+    glScissor(0,0,SIZE,SIZE);
     glEnable(GL_SCISSOR_TEST);
     glBindTexture(GL_TEXTURE_2D,this->shadow_id);
@@ -133,5 +135,5 @@
     
     glDisable(GL_SCISSOR_TEST);
-    glViewport(0,0,1024,768); //Achtung: hier Aufloesung von Orxonox einstellen!
+    glViewport(0,0,400,300); //Achtung: hier Aufloesung von Orxonox einstellen!
      
     
@@ -159,4 +161,49 @@
 
     
+}
+
+/**
+    brief takes the ground data from the world.cc class and passes it to shadow.cc
+
+*/
+
+void Shadow::setGround()
+{
+    this->ground_id=glGenLists(1);
+    glNewList(this->ground_id,GL_COMPILE);
+    glBegin(GL_QUADS);
+    for(int i=0;i<100;i+=1)
+	for(int j=0;j<80;j+=1)
+	    {
+	    glNormal3f(normal_vectors[i][j].x,normal_vectors[i][j].y,normal_vectors[i][j].z);
+	    glTexCoord2f(0.0f,0.0f);
+	    glVertex3f(vertexes[0][i][j].x,vertexes[0][i][j].y,vertexes[0][i][j].z);
+	    glNormal3f(normal_vectors[i+1][j].x,normal_vectors[i+1][j].y,normal_vectors[i+1][j].z);
+	    glTexCoord2f(1.0f,0.0f);
+	    glVertex3f(vertexes[1][i][j].x,vertexes[1][i][j].y,vertexes[1][i][j].z);
+	    glNormal3f(normal_vectors[i+1][j+1].x,normal_vectors[i+1][j+1].y,normal_vectors[i+1][j+1].z);
+	    glTexCoord2f(1.0f,1.0f);
+	    glVertex3f(vertexes[2][i][j].x,vertexes[2][i][j].y,vertexes[2][i][j].z);
+	    glNormal3f(normal_vectors[i][j+1].x,normal_vectors[i][j+1].y,normal_vectors[i][j+1].z);
+	    glTexCoord2f(0.0f,1.0f);
+	    glVertex3f(vertexes[3][i][j].x,vertexes[3][i][j].y,vertexes[3][i][j].z);
+	    }
+    glEnd();
+    glEndList();    
+
+
+
+}
+
+void Shadow::setNormal(Vector a,int i,int j)
+{
+    normal_vectors[i][j]=a;
+
+}
+
+void Shadow::setVertexNum(Vector a,int i,int j,int num)
+{
+    vertexes[num][i][j]=a;
+
 }
 /**
@@ -209,14 +256,14 @@
     createShadow();
     
-    /*glClearColor(0,0,0,0);
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-    glMatrixMode(GL_PROJECTION);
-    glLoadIdentity();
-    gluPerspective(45,4.0/3.0,.5,100);
-    glMatrixMode(GL_MODELVIEW);
-    glLoadIdentity();
-    
-    gluLookAt(this->cameraPos[0],this->cameraPos[1],this->cameraPos[2],this->playerPos[0],this->playerPos[1],this->playerPos[2],0,0,1);
-    */
+    //glClearColor(0,0,0,0);
+    //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+    //glMatrixMode(GL_PROJECTION);
+    //glLoadIdentity();
+    //gluPerspective(45,4.0/3.0,.5,100);
+    //glMatrixMode(GL_MODELVIEW);
+    //glLoadIdentity();
+    
+    //gluLookAt(this->cameraPos[0],this->cameraPos[1],this->cameraPos[2],this->playerPos[0],this->playerPos[1],this->playerPos[2],0,0,1);
+    
     glEnable(GL_TEXTURE_GEN_S);
     glEnable(GL_TEXTURE_GEN_T);
@@ -228,4 +275,5 @@
     glLoadIdentity();
     glTranslatef(0.5,0.5,1.0);
+    glScalef(0.5,0.5,1.0);
     glOrtho(-1,1,-1,1,-1,1);
     
@@ -237,5 +285,5 @@
     glEnable(GL_BLEND);
     glBlendFunc(GL_DST_COLOR,GL_SRC_COLOR);
-    glCallList(ground_id);
+    glCallList(this->ground_id);
     glDisable(GL_BLEND);
     
Index: orxonox/branches/shadows/src/shadow.h
===================================================================
--- orxonox/branches/shadows/src/shadow.h	(revision 3712)
+++ orxonox/branches/shadows/src/shadow.h	(revision 3728)
@@ -23,4 +23,5 @@
 #include "world_entity.h"
 #include "player.h"
+#include "vector.h"
 
 //! A Class to handle the Shadow
@@ -36,4 +37,6 @@
 	unsigned char *image;
 	OBJModel* player;
+	Vector normal_vectors[100][80];
+	Vector vertexes[4][100][80];
 	//playerangle used to obtain information about the angle of the player
 	Player* playerangle;
@@ -43,10 +46,14 @@
 	void m_inverse(const float *m,float *out);
 	
+	
     
     public:
-	Shadow(OBJModel* player,Player* playerangle,float groundVertexes[]);
+	Shadow(OBJModel* player,Player* playerangle);
 	~Shadow();
 	void init();
 	void draw();
+	void setGround();
+	void setNormal(Vector a,int i,int j);
+	void setVertexNum(Vector a,int i,int j,int num);
 	void updatePosition(float x,float y,float z);
 
Index: orxonox/branches/shadows/src/world.cc
===================================================================
--- orxonox/branches/shadows/src/world.cc	(revision 3712)
+++ orxonox/branches/shadows/src/world.cc	(revision 3728)
@@ -44,4 +44,5 @@
   this->debugWorldNr = -1;
   this->entities = new tList<WorldEntity>();
+  
 }
 
@@ -291,6 +292,6 @@
 	    
 	    //create shadow
-	    float a[]={1.0,1.0,1.0,4.0};
-	    this->shadow =new Shadow(myPlayer->model,(Player*)myPlayer,a);	    
+	    
+	    this->shadow =new Shadow(myPlayer->model,(Player*)myPlayer);	    
 	    shadow->init();	    	    
 	    
@@ -406,5 +407,5 @@
   
   
-  glBegin(GL_QUADS);
+  
   
   
@@ -419,4 +420,7 @@
   float height [sizeX][sizeZ];
   Vector normal_vectors[sizeX][sizeZ];
+  Vector vertexes[sizeX][sizeZ];
+  
+  glBegin(GL_QUADS);
   
   
@@ -453,4 +457,5 @@
 	normal_vectors[i][j]=c1.cross(v3-v5)+c2.cross(v4-v2)+c3.cross(v5-v3)+c4.cross(v2-v4);
 	normal_vectors[i][j].normalize();
+	shadow->setNormal(normal_vectors[i][j],i,j);
       }
 
@@ -468,4 +473,11 @@
 	a[2]=1.0;
 	glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	shadow->setVertexNum(v1,i,j,0);
+	shadow->setVertexNum(v2,i,j,1);
+	shadow->setVertexNum(v3,i,j,2);
+	shadow->setVertexNum(v4,i,j,3);
+	
+	
+		
 	
 	glNormal3f(normal_vectors[i][j].x, normal_vectors[i][j].y, normal_vectors[i][j].z);
@@ -473,5 +485,4 @@
 	//glTexCoord2f((float)i/(float)sizeX,(float)j/(float)sizeZ);
 	glVertex3f(v1.x, v1.y, v1.z);
-	
 	
 	glNormal3f(normal_vectors[i+1][j].x, normal_vectors[i+1][j].y, normal_vectors[i+1][j].z);
@@ -492,4 +503,5 @@
       }
   glEnd();
+  shadow->setGround();
   
   // Disable Textures Again, for Performance reasons.
