Changeset 3309 in orxonox.OLD for orxonox/branches/parenting/src/environment.cc
- Timestamp:
- Dec 30, 2004, 1:51:59 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/parenting/src/environment.cc
r3302 r3309 21 21 #include "world_entity.h" 22 22 #include "vector.h" 23 #include "importer/object.h" 23 24 24 25 using namespace std; 25 26 26 27 27 //Sorry Bensch28 #define LEVEL_LENGTH 50029 28 30 29 Environment::Environment () : WorldEntity() 31 30 { 32 33 /* 34 //Sorry Bensch: x,y = 10 35 for (int x = 0; x < 50; x++) 36 { 37 for (int y = 0; y < 50; y++) 38 { 39 mountainTest[x][y] =0; 40 41 } 42 } 43 //Sorry Bensch: x,y = 9 44 for (int x = 1; x < LEVEL_LENGTH; x++) 45 { 46 for (int y = 1; y < LEVEL_LENGTH; y++) 47 { 48 //mountainTest[x][y] = (float)random() / 900000000; 49 mountainTest[x][y] = (float)(random() % 4); 50 } 51 } 52 */ 31 //this->model = new Object("reaplow.obj"); 53 32 } 54 33 55 34 56 35 57 Environment::~Environment () {} 36 Environment::~Environment () 37 { 38 //delete this->model; 39 } 58 40 59 41 void Environment::tick (float time) {} … … 70 52 glLoadIdentity(); 71 53 float matrix[4][4]; 72 54 73 55 glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); 56 //rotate 74 57 this->getAbsDir ().matrix (matrix); 58 glMultMatrixf((float*)matrix); 75 59 76 77 //glTranslatef(getPlacement()->r.x,getPlacement()->r.y,getPlacement()->r.z); 78 //getPlacement()->w.matrix (matrix); 79 glMultMatrixf ((float*)matrix); 80 81 glBegin(GL_TRIANGLES); 82 glColor3f(1,0,1); 83 glVertex3f(0,0,0.5); 84 glVertex3f(-0.5,0,-1); 85 glVertex3f(0.5,0,-1); 86 87 glVertex3f(0,0,0.5); 88 glVertex3f(0,0.5,-1); 89 glVertex3f(0,-0.5,-1); 90 glEnd(); 91 92 glBegin(GL_QUADS); 93 glColor3f(1,0,1); 94 glVertex3f(0.5,0.5,-1); 95 glVertex3f(0.5,-0.5,-1); 96 glVertex3f(-0.5,-0.5,-1); 97 glVertex3f(-0.5,0.5,-1); 98 glEnd(); 60 glMatrixMode(GL_MODELVIEW); 61 // this->model->draw(); 99 62 } 100 63 101 /*102 void Environment::paint()103 {104 105 glPushMatrix();106 //glScalef(0.5, 0.5, 1.0);107 //glTranslatef(xCor, yCor, zCor);108 glTranslatef( -16.0, -2.0, 0.0);109 110 glColor3f(0.0, 1.0, 0.0);111 112 glBegin(GL_LINES);113 for (int x = 0; x < LEVEL_LENGTH; x += 1)114 {115 for (int y = 0; y < 190; y += 1)116 {117 glVertex3f((float)(2*x), (float)(2*y), mountainTest[x][y]);118 glVertex3f((float)(2*x), (float)(2*(y+1)), mountainTest[x][y+1]);119 }120 }121 glEnd();122 123 124 glBegin(GL_LINES);125 for (int y = 0; y < LEVEL_LENGTH; y += 1)126 {127 for (int x = 0; x < 90; x += 1)128 {129 glVertex3f((float)(2*x), (float)(2*y), mountainTest[x][y]);130 glVertex3f((float)(2*(x+1)), (float)(2*y), mountainTest[x+1][y]);131 }132 }133 glEnd();134 135 glPopMatrix();136 137 }138 139 void Environment::drawEnvironment()140 {141 142 }143 144 */
Note: See TracChangeset
for help on using the changeset viewer.