/* 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 using namespace std; Environment::Environment () { for (int x = 0; x < 10; x++) { for (int y = 0; y < 10; y++) { mountainTest[x][y] = 0; } } for (int x = 1; x < 9; x++) { for (int y = 1; y < 9; y++) { mountainTest[x][y] = (float)rand() / 900000000; } } } 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 < 9; x += 1) { for (int y = 0; y < 9; 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 < 9; y += 1) { for (int x = 0; x < 9; 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(); }