Index: orxonox/trunk/IDEAS
===================================================================
--- orxonox/trunk/IDEAS	(revision 1879)
+++ orxonox/trunk/IDEAS	(revision 1883)
@@ -3,4 +3,7 @@
 all: fill in your ideas here!
 
-Spacecraft trasformation
+- Spacecraft transformations
+- weather influences: fog, rain, sun, wind
+- team play: fight with team-mates
+- RPG style: intelligence, constitution, force/power
 
Index: orxonox/trunk/core/Makefile
===================================================================
--- orxonox/trunk/core/Makefile	(revision 1879)
+++ orxonox/trunk/core/Makefile	(revision 1883)
@@ -40,5 +40,6 @@
 	player.o \
 	world.o \
-	input_output.o
+	input_output.o \
+	environment.o
 
 TARGET = orxonox
Index: orxonox/trunk/core/environment.cc
===================================================================
--- orxonox/trunk/core/environment.cc	(revision 1883)
+++ orxonox/trunk/core/environment.cc	(revision 1883)
@@ -0,0 +1,90 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: ...
+   co-programmer: ...
+*/
+
+
+#include "environment.h"
+#include <iostream>
+
+
+using namespace std;
+
+
+
+Environment::Environment () 
+{
+
+  for (int x = 1; x < 9; x++)
+    {
+      for (int y = 1; y < 9; y++)
+	{
+	  mountainTest[x][y] = (float)random() / 900000000;
+	                                         
+	}
+    }
+
+ for (int x = 0; x < 10; x++)
+    {
+      for (int y = 0; y < 10; y++)
+	{
+	  cout << " " << mountainTest[x][y] << " ";
+	  
+	}
+      cout << endl;
+    }
+}
+
+
+
+Environment::~Environment () {}
+
+
+
+void Environment::drawEnvironment() 
+{
+  glPushMatrix();
+  //glScalef(0.5, 0.5, 1.0);
+  //glTranslatef(xCor, yCor, zCor);
+  glTranslatef( -16.0, -2.0, 0.0);
+  
+  glColor3f(0.0, 1.0, 0.0);
+  
+  glBegin(GL_LINES);
+  for (int x = 0; x < 10; x += 1)
+    {
+      for (int y = 0; y < 10; y += 1)
+	{
+	  glVertex3f((float)(2*x), (float)(2*y), mountainTest[x][y]);
+	  glVertex3f((float)(2*x), (float)(2*(y+1)), mountainTest[x][y+1]);
+	}
+    }
+  glEnd();
+  
+  
+  glBegin(GL_LINES);
+  for (int y = 0; y < 10; y += 1)
+    {
+      for (int x = 0; x < 10; 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();
+}
+
Index: orxonox/trunk/core/environment.h
===================================================================
--- orxonox/trunk/core/environment.h	(revision 1883)
+++ orxonox/trunk/core/environment.h	(revision 1883)
@@ -0,0 +1,29 @@
+
+#include <GL/glut.h>
+#include <stdlib.h>
+
+#ifndef PROTO_CLASS_H
+#define PROTO_CLASS_H
+
+
+
+class Environment {
+
+ private:
+  float xCor;
+  float yCor;
+  float zCor;
+
+  float mountainTest[10][10];
+
+ public:
+  Environment ();
+  ~Environment ();
+
+  void drawEnvironment(void);
+  void setEnvPosition(void);
+  void getEnvPosition(void);
+
+};
+
+#endif
Index: orxonox/trunk/core/orxonox.cc
===================================================================
--- orxonox/trunk/core/orxonox.cc	(revision 1879)
+++ orxonox/trunk/core/orxonox.cc	(revision 1883)
@@ -26,4 +26,5 @@
 /* class definition header */
 #include "orxonox.h"
+#include "environment.h"
 
 
@@ -70,5 +71,6 @@
 {
   glutInit(&argc, argv);
-  glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
+  glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
+  glEnable(GL_DEPTH_TEST);
   glutInitWindowSize(500, 500);
   //glutFullScreen();
@@ -93,11 +95,12 @@
   glClearColor(0.0, 0.0, 0.0, 0.0);
   world = new World;
+  (*world).initEnvironement();
   Player* localPlayer = new Player;
   io = new InputOutput(world, localPlayer);
   (*world).addPlayer(localPlayer);
-  //  (*localPlayer).addIO(io);
-
-  //glutIgnoreKeyRepeat(1);                 /* for win32 */
-  //glutSetKeyRepeat(GLUT_KEY_REPEAT_OFF);  /* for linux X11 */
+  Environment *env = new Environment;
+  (*world).addEnv(env);
+  
+
   glutSpecialFunc(specFunc); 
   glutSpecialUpFunc(releaseKey);
@@ -144,4 +147,5 @@
     break;
   case 27:
+  case 'q':
     quitGame();
     break;
@@ -208,5 +212,5 @@
 void Orxonox::display() 
 {
-  glClear(GL_COLOR_BUFFER_BIT);
+  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
   glColor3f(0.0, 0.5, 0.6);
Index: orxonox/trunk/core/player.cc
===================================================================
--- orxonox/trunk/core/player.cc	(revision 1879)
+++ orxonox/trunk/core/player.cc	(revision 1883)
@@ -78,4 +78,4 @@
 
 
-  cout << "x: " << xCor << " y: " << yCor << endl;
+  //cout << "x: " << xCor << " y: " << yCor << endl;
 }
Index: orxonox/trunk/core/world.cc
===================================================================
--- orxonox/trunk/core/world.cc	(revision 1879)
+++ orxonox/trunk/core/world.cc	(revision 1883)
@@ -32,4 +32,5 @@
   lastPlayer = null;
   lastNPC = null;
+  lastEnv = null;
 }
 
@@ -99,4 +100,28 @@
     }
   lastNPC = listMember;
+}
+
+
+/** 
+   \brief Add environmental object
+   \param player A reference to the new env object
+   
+   Add a new Environment to the world. Env has to be initialised before.
+*/
+bool World::addEnv(Environment* env) 
+{
+  envList* listMember = new envList;
+  listMember->env = env;
+  if ( lastEnv != null ) 
+    {
+      listMember->number = lastEnv->number + 1;
+      listMember->next = lastEnv;
+    }
+  else 
+    {
+      listMember->number = 0;
+      listMember->next = null;
+    }
+  lastEnv = listMember;
 }
 
@@ -137,41 +162,70 @@
     }
   /* now draw the rest of the world: environement */
+  /* second draw all npcs */
+  envList* tmpEnv = lastEnv;
+  while( tmpEnv != null )
+    {
+      (*tmpEnv->env).drawEnvironment();
+      tmpEnv = tmpEnv->next;
+    }
+
+  /*
   glColor3f(0.0, 1.0, 0.0);
   glBegin(GL_LINES);
-  glVertex3f(0.0, -10.0, 0.0);
-  glVertex3f(0.0, 200.0, 0.0);
-
-  glVertex3f(5.0, -10.0, 0.0);
-  glVertex3f(5.0, 200.0, 0.0);
-
-  glVertex3f(-5.0, -10.0, 0.0);
-  glVertex3f(-5.0, 200.0, 0.0);
-
-  glVertex3f(10.0, -10.0, 0.0);
-  glVertex3f(10.0, 200.0, 0.0);
-
-  glVertex3f(-10.0, -10.0, 0.0);
-  glVertex3f(-10.0, 200.0, 0.0);
-
-  glVertex3f(15.0, -10.0, 0.0);
-  glVertex3f(15.0, 200.0, 0.0);
-
-  glVertex3f(-15.0, -10.0, 0.0);
-  glVertex3f(-15.0, 200.0, 0.0);
-
-  glVertex3f(20.0, -10.0, 0.0);
-  glVertex3f(20.0, 200.0, 0.0);
-
-  glVertex3f(-20.0, -10.0, 0.0);
-  glVertex3f(-20.0, 200.0, 0.0);
-
-  glVertex3f(25.0, -10.0, 0.0);
-  glVertex3f(25.0, 200.0, 0.0);
-
-  glVertex3f(-25.0, -10.0, 0.0);
-  glVertex3f(-25.0, 200.0, 0.0);
+  for (int x = 0; x <= 35; x += 5)
+    {
+      glVertex3f((float)x, -10.0, 0.0);
+      glVertex3f((float)x, 200.0, 0.0);
+
+      glVertex3f(-(float)x, -10.0, 0.0);
+      glVertex3f(-(float)x, 200.0, 0.0);
+    }
+  for (int x = -10; x<= 200; x += 5)
+    {
+      glVertex3f(-50.0, (float)x, 0.0);
+      glVertex3f(50.0, (float)x, 0.0);
+    }
   glEnd();
-
-
+  */
+  
+  
+  glColor3f(0.0, 1.0, 0.0);
+  
+  glBegin(GL_LINES);
+  for (int x = 0; x < 60; x += 2)
+    {
+      for (int y = 0; y < 60; y += 2)
+	{
+	  glVertex3f((float)(x - 30), (float)(y - 30), surface[x][y]);
+	  glVertex3f((float)(x - 30), (float)(y - 28), surface[x][y+2]);
+	}
+    }
+  glEnd();
+  
+  
+  glBegin(GL_LINES);
+  for (int y = 0; y < 60; y += 2)
+    {
+      for (int x = 0; x < 60; x += 2)
+	{
+	  glVertex3f((float)(x - 30), (float)(y - 30), surface[x][y]);
+	  glVertex3f((float)(x - 28), (float)(y - 30), surface[x+2][y]);
+	}
+    }
+  glEnd();
+  
+}
+
+
+void World::initEnvironement()
+{
+
+ for (int x = 0; x < 60; x += 2)
+    {
+      for (int y = 0; y < 60; y += 2)
+	{
+	  surface[x][y] = 0;
+	}
+    }
 }
 
@@ -217,8 +271,14 @@
     }
 
+
+  /* test addEnv */
+  cout << "addEnv test..." << endl;
+  envList* en = lastEnv;
+  while ( en != null )
+    {
+      cout << "env " << en->number << " was found" << endl;
+      en = en->next;
+    }
+
   /* test drawWorld() */
-  cout << "drawWorld()..." << endl;
-  drawWorld();
-
-  cout << "World::testThaTest() finished" << endl;
-}
+}
Index: orxonox/trunk/core/world.h
===================================================================
--- orxonox/trunk/core/world.h	(revision 1879)
+++ orxonox/trunk/core/world.h	(revision 1883)
@@ -5,6 +5,9 @@
 #define WORLD_H
 
+#include <stdlib.h>
+
 #include "npc.h"
 #include "player.h"
+#include "environment.h"
 #include "stdincl.h"
 
@@ -36,4 +39,12 @@
   npcList* lastNPC;
 
+  /* a list of all environmental objects */
+  struct envList {
+    envList* next;
+    Environment* env;
+    int number;
+  };
+  envList* lastEnv;
+
   bool addPlayer(Player* player);
   bool removePlayer(Player* player);
@@ -43,8 +54,13 @@
   bool removeNPC(NPC* npc);
 
+  bool addEnv(Environment* env);
 
   void drawWorld(void);
+  void initEnvironement(void);
   void updateWorld(void);
   void testThaTest(void);
+
+ private:
+  float surface[120][120];
 
 
