Index: /orxonox/branches/dave/core/environment.cc
===================================================================
--- /orxonox/branches/dave/core/environment.cc	(revision 2241)
+++ /orxonox/branches/dave/core/environment.cc	(revision 2242)
@@ -18,4 +18,5 @@
 
 #include "environment.h"
+#include <ostream>
 #include <iostream>
 
@@ -25,9 +26,11 @@
 //Sorry Bensch
 #define LEVEL_LENGTH 500
+dVector V1V2,V1V3,Kreuz;
+dVector V1,V2,V3;
 
 Environment::Environment () 
 {
 
-  //Sorry Bensch: x,y = 10
+ //Sorry Bensch: x,y = 10
   for (int x = 0; x < 50; x++)
     {
@@ -43,7 +46,8 @@
       for (int y = 1; y < LEVEL_LENGTH; y++)
 	{
-	  //mountainTest[x][y] = (float)random() / 900000000;
-	  mountainTest[x][y] = (float)(random() % 4);                                       
+	 //mountainTest[x][y] = (float)random() / 900000000;
+	 mountainTest[x][y] = (float)(random() % 2);                                       
 	}
+	
     }
 }
@@ -59,34 +63,99 @@
   glPushMatrix();
   glEnable(GL_DEPTH_TEST);
+  glEnable(GL_LIGHTING);
+  
   //glScalef(0.5, 0.5, 1.0);
   //glTranslatef(xCor, yCor, zCor);
-  glTranslatef( -100.0, -50.0, 0.0);
+  glTranslatef( -25.0, -10.0, 0.0);
   
-  glColor4f(0.0, 0.3, 0.4,1.0);
+  glColor3f(0.6, 0.6, 0.4);
+  glNormal3d(0,0,1);
+  glBegin(GL_TRIANGLES);
   
-  glBegin(GL_LINES);
-  for (int x = 0; x < LEVEL_LENGTH; x += 1)
-    {
-      for (int y = 0; y < 190; y += 1)
-	{
-	  glVertex3f((float)(2*x), (float)(2*y), mountainTest[x][y]);
-	  glVertex3f((float)(2*x), (float)(2*(y+1)), mountainTest[x][y+1]);
-	}
-    }
+  for (int x=0;x<60;x+=1)
+  {
+    for(int y=-30+DataTank::yOffset;y<40+DataTank::yOffset;y+=1)
+    { 
+     if((int)DataTank::yOffset%2==1)
+      {
+      V1.x=x;V1.y=y;V1.z=mountainTest[x][y];
+      V2.x=x;V2.y=y+1;V2.z=mountainTest[x][y+1];
+      V3.x=x+1;V3.y=y;V3.z=mountainTest[x+1][y];
+      glNormal3d(-(Environment::CalcNormale(&V1,&V2,&V3)).x,-(Environment::CalcNormale(&V1,&V2,&V3)).y,-(Environment::CalcNormale(&V1,&V2,&V3).z));
+      
+      glVertex3f((float)(x),(float)(y),mountainTest[x][y]);
+      glVertex3f((float)(x),(float)(y+1),mountainTest[x][y+1]);
+      glVertex3f((float)(x+1),(float)(y),mountainTest[x+1][y]);
+      
+      V1.x=x;V1.y=y+1;V1.z=mountainTest[x][y+1];
+      V2.x=x+1;V2.y=y+1;V2.z=mountainTest[x+1][y+1];
+      V3.x=x+1;V3.y=y;V3.z=mountainTest[x+1][y];
+      glNormal3d(-(Environment::CalcNormale(&V1,&V2,&V3)).x,-(Environment::CalcNormale(&V1,&V2,&V3)).y,-(Environment::CalcNormale(&V1,&V2,&V3).z));
+      
+      glVertex3f((float)(x),(float)(y+1),mountainTest[x][y+1]);
+      glVertex3f((float)(x+1),(float)(y+1),mountainTest[x+1][y+1]);
+      glVertex3f((float)(x+1),(float)(y),mountainTest[x+1][y]);
+      }
+     else
+     {
+     V1.x=x;V1.y=y+1;V1.z=mountainTest[x][y+1];
+     V2.x=x;V2.y=y+2;V2.z=mountainTest[x][y+2];
+     V3.x=x+1;V3.y=y+1;V3.z=mountainTest[x+1][y+1];
+     glNormal3d(-(Environment::CalcNormale(&V1,&V2,&V3).x),-(Environment::CalcNormale(&V1,&V2,&V3).y),-(Environment::CalcNormale(&V1,&V2,&V3).z));
+     
+     glVertex3f((float)(x),(float)(y+1),mountainTest[x][y+1]);
+     glVertex3f((float)(x),(float)(y+2),mountainTest[x][y+2]);
+     glVertex3f((float)(x+1),(float)(y+1),mountainTest[x+1][y+1]);
+    
+     
+     V1.x=x;V1.y=y+2;V1.z=mountainTest[x][y+2];
+     V2.x=x+1;V2.y=y+2;V2.z=mountainTest[x+1][y+2];
+     V3.x=x+1;V3.y=y+1;V3.z=mountainTest[x+1][y+1];
+     
+     glNormal3d(-(Environment::CalcNormale(&V1,&V2,&V3).x),-(Environment::CalcNormale(&V1,&V2,&V3).y),-(Environment::CalcNormale(&V1,&V2,&V3).z));
+     
+     glVertex3f((float)(x),(float)(y+2),mountainTest[x][y+2]);
+     glVertex3f((float)(x+1),(float)(y+2),mountainTest[x+1][y+2]);
+     glVertex3f((float)(x+1),(float)(y+1),mountainTest[x+1][y+1]); 
+    }}
+    
+    
+  }
   glEnd();
+  /*glBegin(GL_LINES);
+  for(int y=0+DataTank::yOffset/2;y<25+DataTank::yOffset/2;y+=1)
+  {
+    for(int x=0;x<25;x+=1)
+     {
+     glVertex3f((float)(2*x),(float)(2*y),mountainTest[x][y]);
+     glVertex3f((float)(2*(x+1)),(float)(2*y),mountainTest[x+1][y]);
+     }
+     }
   
-  
-  glBegin(GL_LINES);
-  for (int y = 0; y < LEVEL_LENGTH; y += 1)
-    {
-      for (int x = 0; x < 90; x += 1)
-	{
-	  glVertex3f((float)(2*x), (float)(2*y), mountainTest[x][y]);
-	  glVertex3f((float)(2*(x+1)), (float)(2*y), mountainTest[x+1][y]);
-	}
-    }
   glEnd();
-  
+  */
   glPopMatrix();
 }
 
+
+
+dVector Environment::CalcNormale(dVector *V1, dVector *V2, dVector *V3){
+ GLdouble Betrag;
+ V1V2.x = V2->x - V1->x;
+ V1V2.y = V2->y -V1->y;
+ V1V2.z = V2->z -V1->z;
+ V1V3.x = V3->x -V1->x;
+ V1V3.y = V3->y -V1->y;
+ V1V3.z = V3->z -V1->z;
+ 
+ Kreuz.x =+((V1V2.y * V1V3.z) -(V1V2.z * V1V3.y));
+ Kreuz.y =-((V1V2.x *V1V3.z) -(V1V2.z * V1V3.x));
+ Kreuz.z =+((V1V2.x * V1V3.y) - (V1V2.y * V1V3.x));
+ 
+ Betrag =sqrt(pow(Kreuz.x, 2) + pow(Kreuz.y,2) +pow(Kreuz.z,2));
+ return Kreuz;
+ }
+ 
+ 
+ 
+ 
Index: /orxonox/branches/dave/core/environment.h
===================================================================
--- /orxonox/branches/dave/core/environment.h	(revision 2241)
+++ /orxonox/branches/dave/core/environment.h	(revision 2242)
@@ -7,4 +7,11 @@
 
 #include "data_tank.h"
+typedef struct dVektor{
+GLdouble x;
+GLdouble y;
+GLdouble z;
+
+
+}dVector;
 
 class Environment {
@@ -16,5 +23,8 @@
 
   float mountainTest[10][10];
-
+  
+  
+  
+  
  public:
   Environment ();
@@ -24,4 +34,5 @@
   void setEnvPosition(void);
   void getEnvPosition(void);
+  dVector CalcNormale(dVector *V1, dVector *V2, dVector *V3);
 
 };
Index: /orxonox/branches/dave/core/orxonox.cc
===================================================================
--- /orxonox/branches/dave/core/orxonox.cc	(revision 2241)
+++ /orxonox/branches/dave/core/orxonox.cc	(revision 2242)
@@ -73,10 +73,18 @@
 int Orxonox::globalInit (int argc, char** argv) 
 {
-  glEnable(GL_DEPTH_TEST);
+  //glEnable(GL_DEPTH_TEST);
   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
   glutInit(&argc, argv);
   glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB | GLUT_DEPTH);
   glEnable(GL_NORMALIZE);
-  glEnable(GL_COLOR_MATERIAL);
+  
+ 
+  //glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,1);
+  
+  
+  
+  
+  
+  
   /*glEnable(GL_LIGHT0);
   glEnable(GL_LIGHTING);
@@ -137,24 +145,9 @@
   npc->setCollisionRadius(1.0);
   world->addNPC(npc);
-
-  NPC* npc2 = new NPC;
-  npc2->setPosition(-2.0, 10.0, 3.0);
-  npc2->setCollisionRadius(1.0);
+  
+  NPC* npc2=new NPC;
+  npc2->setPosition(3,10,3);
+  npc2->setCollisionRadius(1);
   world->addNPC(npc2);
-  
-  NPC* npc3 = new NPC;
-  npc3->setPosition(3.0, 30.0, 3.0);
-  npc3->setCollisionRadius(1.0);
-  world->addNPC(npc3);
-  
-  NPC* npc4 = new NPC;
-  npc4->setPosition(-2.0, 35.0, 3.0);
-  npc4->setCollisionRadius(1.0);
-  world->addNPC(npc4);
-  
-  NPC* npc5 = new NPC;
-  npc5->setPosition(5.0, 45.0, 3.0);
-  npc5->setCollisionRadius(1.0);
-  world->addNPC(npc5);
 
   glutSpecialFunc(specFunc); 
@@ -173,6 +166,6 @@
   /* this is very very unsafe: io could be uninit */
   io->setPlayerStep(19.0/fps); /* set player to propper speed */
-  localPlayer->shootLaser->setShootStep(20.0/fps); /* set shoot speed */
-  world->setWorldStep(7.0/fps); /* set the speed of the terrain moving away */
+  localPlayer->shootLaser->setShootStep(400.0/fps); /* set shoot speed */
+  world->setWorldStep(5.0/fps); /* set the speed of the terrain moving away */
   fps = 0;
   inputEnabled = true;
Index: /orxonox/branches/dave/core/player.cc
===================================================================
--- /orxonox/branches/dave/core/player.cc	(revision 2241)
+++ /orxonox/branches/dave/core/player.cc	(revision 2242)
@@ -76,7 +76,8 @@
 {
     shootLaser->addShoot(xCor,yCor+1.0,5);
-    //shootLaser->addShootExt(xCor,yCor,zCor,.1,.4,.0);
+    shootLaser->addShootExt(xCor,yCor,zCor,.1,.4,.0);
+    shootLaser->addShootExt(xCor,yCor,zCor,-.1,.4,.0);
     //shootLaser->addShootdExt(xCor,yCor,zCor,-.1,.4,.0);
-    shootRocket->addBackParable(xCor,yCor,zCor);
+    //shootRocket->addBackParable(xCor,yCor,zCor);
 
 
@@ -96,5 +97,12 @@
   glPopMatrix();*/ 
   glPushMatrix();
-  //glEnable(GL_DEPTH_TEST);
+  glEnable(GL_NORMALIZE);
+  glEnable(GL_COLOR_MATERIAL);
+  glEnable(GL_LIGHTING);
+  glEnable(GL_LIGHT0);
+  GLfloat LPosition[4]={0,20,30,1};
+  glLightfv(GL_LIGHT0,GL_POSITION,&LPosition[0]);
+  glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE);
+  
   glTranslatef(xCor,yCor,5.0);
   glRotatef(3*a,1.0,0.0,0.0);
@@ -102,24 +110,40 @@
   //glTranslatef(xCor,yCor,3.0);
   glBegin(GL_QUADS);
-  glColor3f(1.0,0.0,0.0);
+  glColor3f(.2,0.5,0.5);
   glNormal3f(-1.0,0.0,0.0);
   glVertex3f(-1.0,-1.0,-1.0);
   glVertex3f(-1.0,-1.0,1.0);
-  glVertex3f(-.6,1.0,0.4);
-  glVertex3f(-.6,1.0,-0.4);
+  glVertex3f(-1,1.0,0.4);
+  glVertex3f(-1,1.0,-0.4);
   
-  glNormal3f(0.0,-1.0,0.0);
-  glColor3f(0.0,1.0,0.0);
-  glVertex3f(-.6,1.0,.4);
-  glVertex3f(-.6,1.0,-.4);
-  glVertex3f(.6,1.0,-.4);
-  glVertex3f(.6,1.0,.4);
+  glNormal3f(1,0,0);
+  glVertex3f(-.99,-1,-1);
+  glVertex3f(-.99,-1,1);
+  glVertex3f(-.99,1,.4);
+  glVertex3f(-.99,1,-.4);
   
-  glNormal3f(-1.0,0.0,0.0);
-  glColor3f(0.0,0.0,1.0);
-  glVertex3f(.6,1.0,.4);
-  glVertex3f(.6,1.0,-.4);
+  glNormal3f(0.0,1.0,0.0);
+  glVertex3f(-1,1.0,.4);
+  glVertex3f(-1,1.0,-.4);
+  glVertex3f(1,1.0,-.4);
+  glVertex3f(1,1.0,.4);
+  
+  glNormal3f(0,-1,0);
+  glVertex3f(-1,.99,.4);
+  glVertex3f(-1,.99,-.4);
+  glVertex3f(1,.99,-.4);
+  glVertex3f(1,.99,.4);
+  
+  glNormal3f(1.0,0.0,0.0);
+  glVertex3f(1,1,.4);
+  glVertex3f(1,1,-.4);
   glVertex3f(1.0,-1.0,-1.0);
   glVertex3f(1.0,-1.0,1.0);
+  
+  glNormal3f(-1,0,0);
+  glVertex3f(.99,1,.4);
+  glVertex3f(.99,1,-.4);
+  glVertex3f(.99,-1,-1);
+  glVertex3f(.99,-1,1);
   
   
@@ -133,4 +157,5 @@
   
   /* draw all the shoots additionaly */
+  glColor3f(0,0,1);
   shootLaser->drawShoot();
   shootRocket->drawShoot();
Index: /orxonox/branches/dave/core/shoot_laser.cc
===================================================================
--- /orxonox/branches/dave/core/shoot_laser.cc	(revision 2241)
+++ /orxonox/branches/dave/core/shoot_laser.cc	(revision 2242)
@@ -29,5 +29,5 @@
 {
   lastShoot = null;
-  step = 1.0;
+  step = .01;
   inhibitor = 0;
 }
Index: /orxonox/branches/dave/core/world.cc
===================================================================
--- /orxonox/branches/dave/core/world.cc	(revision 2241)
+++ /orxonox/branches/dave/core/world.cc	(revision 2242)
@@ -206,5 +206,5 @@
   /* draw the ground grid  */
   glColor3f(0.3, 0.3, 0.0); 
-  glBegin(GL_LINES);
+ // glBegin(GL_LINES);
   /* for the moment, we've got only pseudo moving ground 
   for (int y = 0; y < 60; y += 2)
