Changeset 2817 in orxonox.OLD for orxonox/trunk/src/world.cc
- Timestamp:
- Nov 11, 2004, 10:36:51 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world.cc
r2816 r2817 185 185 glLoadIdentity(); 186 186 glColor3f(1.0,0,0); 187 glBegin(GL_ LINES);187 glBegin(GL_QUADS); 188 188 float height [500][100]; 189 189 float size = 2.0; … … 200 200 for (int j = 0; j<=50;j+=1) 201 201 { 202 glVertex3f(size*i, size*j-25*size, height[i][j] -20); 203 glVertex3f(size*i+size, size*j-25*size, height[i+1][j]-20); 204 // glVertex3f(size*i+5.0, size*j+5.0-12size, height[i+1][j+1]-20); 205 glVertex3f(size*i, size*j-25*size, height[i][j] -20); 206 glVertex3f(size*i, size*j+size -25*size, height[i][j+1]-20); 202 Vector* v1 = new Vector (size*i, size*j-25*size, height[i][j] -20); 203 Vector* v2 = new Vector (size*i+size, size*j-25*size, height[i+1][j]-20); 204 Vector* v3 = new Vector (size*i+size, size*j+size-25*size, height[i+1][j+1]-20); 205 Vector* v4 = new Vector (size*i, size*j+size -25*size, height[i][j+1]-20); 206 207 Vector c1 = *v2 - *v1; 208 Vector c2 = *v3 - *v2; 209 Vector c3 = *v4 - *v3; 210 Vector c4 = *v1 - *v4; 211 212 c1.cross(*v4 - *v1); 213 c2.cross(*v1 - *v2); 214 c3.cross(*v2 - *v3); 215 c4.cross(*v3 - *v4); 216 217 glNormal3f(c1.x, c1.y, c1.z); 218 glVertex3f(v1->x, v1->y, v1->z); 219 glNormal3f(c2.x, c2.y, c2.z); 220 glVertex3f(v2->x, v2->y, v2->z); 221 glNormal3f(c3.x, c3.y, c3.z); 222 glVertex3f(v3->x, v3->y, v3->z); 223 glNormal3f(c4.x, c4.y, c4.z); 224 glVertex3f(v4->x, v4->y, v4->z); 225 207 226 } 208 227 }
Note: See TracChangeset
for help on using the changeset viewer.