Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/john/src/environment.cc @ 2035

Last change on this file since 2035 was 1956, checked in by bensch, 20 years ago

orxonox/trunk: now the Trunk should be merged with the new Makefile. Hopefully it works

File size: 1.6 KB
Line 
1
2
3/*
4   orxonox - the future of 3D-vertical-scrollers
5
6   Copyright (C) 2004 orx
7
8   This program is free software; you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation; either version 2, or (at your option)
11   any later version.
12
13   ### File Specific:
14   main-programmer: ...
15   co-programmer: ...
16*/
17
18
19#include "environment.h"
20#include <iostream>
21
22
23using namespace std;
24
25
26
27Environment::Environment () 
28{
29
30
31  for (int x = 0; x < 10; x++)
32    {
33      for (int y = 0; y < 10; y++)
34        {
35          mountainTest[x][y] = 0;
36                                                 
37        }
38    }
39
40  for (int x = 1; x < 9; x++)
41    {
42      for (int y = 1; y < 9; y++)
43        {
44          mountainTest[x][y] = (float)rand() / 900000000;
45                                                 
46        }
47    }
48}
49
50
51
52Environment::~Environment () {}
53
54
55
56void Environment::drawEnvironment() 
57{
58  glPushMatrix();
59  //glScalef(0.5, 0.5, 1.0);
60  //glTranslatef(xCor, yCor, zCor);
61  glTranslatef( -16.0, -2.0, 0.0);
62 
63  glColor3f(0.0, 1.0, 0.0);
64 
65  glBegin(GL_LINES);
66  for (int x = 0; x < 9; x += 1)
67    {
68      for (int y = 0; y < 9; y += 1)
69        {
70          glVertex3f((float)(2*x), (float)(2*y), mountainTest[x][y]);
71          glVertex3f((float)(2*x), (float)(2*(y+1)), mountainTest[x][y+1]);
72        }
73    }
74  glEnd();
75 
76 
77  glBegin(GL_LINES);
78  for (int y = 0; y < 9; y += 1)
79    {
80      for (int x = 0; x < 9; x += 1)
81        {
82          glVertex3f((float)(2*x), (float)(2*y), mountainTest[x][y]);
83          glVertex3f((float)(2*(x+1)), (float)(2*y), mountainTest[x+1][y]);
84        }
85    }
86  glEnd();
87 
88  glPopMatrix();
89}
90
Note: See TracBrowser for help on using the repository browser.