- Timestamp:
- Jan 3, 2005, 2:21:34 PM (20 years ago)
- Location:
- orxonox/branches/parenting/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/parenting/src/camera.cc
r3307 r3323 178 178 //world->calcCameraPos (&lookat, &desiredPlace); 179 179 //FIXME: camera should be made via relative coordinates 180 Vector* cameraOffset = new Vector (-10, 0, 5);180 Vector* cameraOffset = new Vector (-10, 5, 0); 181 181 this->setRelCoor (cameraOffset); 182 182 } … … 247 247 gluLookAt(this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z, 248 248 this->parent->getAbsCoor ().x, this->parent->getAbsCoor ().y, this->parent->getAbsCoor ().z, 249 0.0, 0.0, 1.0);249 0.0, 1.0, 0.0); 250 250 251 251 -
orxonox/branches/parenting/src/player.cc
r3309 r3323 136 136 Vector direction (1.0, 0.0, 0.0); 137 137 //direction = this->absDirection.apply (direction); 138 Vector orthDirection (0.0, 1.0, 0.0);138 Vector orthDirection (0.0, 0.0, 1.0); 139 139 //orthDirection = orthDirection.cross (direction); 140 140 -
orxonox/branches/parenting/src/world.cc
r3321 r3323 272 272 273 273 int sizeX = 100; 274 int size Y= 80;274 int sizeZ = 80; 275 275 float length = 1000; 276 276 float width = 200; 277 277 float widthX = float (length /sizeX); 278 float width Y = float (width /sizeY);279 280 float height [sizeX][size Y];281 Vector normal_vectors[sizeX][size Y];278 float widthZ = float (width /sizeZ); 279 280 float height [sizeX][sizeZ]; 281 Vector normal_vectors[sizeX][sizeZ]; 282 282 283 283 284 284 for ( int i = 0; i<sizeX-1; i+=1) 285 for (int j = 0; j<size Y-1;j+=1)285 for (int j = 0; j<sizeZ-1;j+=1) 286 286 //height[i][j] = rand()/20046 + (j-25)*(j-25)/30; 287 287 #ifdef __WIN32__ … … 291 291 #endif 292 292 293 //Die H ügel ein wenig glätten293 //Die Huegel ein wenig glaetten 294 294 for (int h=1; h<2;h++) 295 295 for (int i=1;i<sizeX-2 ;i+=1 ) 296 for(int j=1;j<size Y-2;j+=1)296 for(int j=1;j<sizeZ-2;j+=1) 297 297 height[i][j]=(height[i+1][j]+height[i][j+1]+height[i-1][j]+height[i][j-1])/4; 298 298 299 299 //Berechnung von normalen Vektoren 300 301 300 for(int i=1;i<sizeX-2;i+=1) 302 for(int j=1;j<size Y-2 ;j+=1)301 for(int j=1;j<sizeZ-2 ;j+=1) 303 302 { 304 Vector v1 = Vector (widthX*(1), widthY*(j) , height[i][j]);305 Vector v2 = Vector (widthX*(i-1), widthY*(j) , height[i-1][j]);306 Vector v3 = Vector (widthX*(i), widthY*(j+1), height[i][j+1]);307 Vector v4 = Vector (widthX*(i+1), widthY*(j), height[i+1][j]);308 Vector v5 = Vector (widthX*(i), widthY*(j-1), height[i][j-1]);303 Vector v1 = Vector (widthX*(1), height[i][j], widthZ*(j) ); 304 Vector v2 = Vector (widthX*(i-1), height[i-1][j], widthZ*(j)); 305 Vector v3 = Vector (widthX*(i), height[i][j+1], widthZ*(j+1)); 306 Vector v4 = Vector (widthX*(i+1), height[i+1][j], widthZ*(j)); 307 Vector v5 = Vector (widthX*(i), height[i][j-1], widthZ*(j-1)); 309 308 310 309 Vector c1 = v2 - v1; … … 319 318 int snowheight=3; 320 319 for ( int i = 0; i<sizeX; i+=1) 321 for (int j = 0; j<size Y;j+=1)320 for (int j = 0; j<sizeZ;j+=1) 322 321 { 323 Vector v1 = Vector (widthX*(i), widthY*(j) -width/2, height[i][j]-20);324 Vector v2 = Vector (widthX*(i+1), widthY*(j) -width/2, height[i+1][j]-20);325 Vector v3 = Vector (widthX*(i+1), widthY*(j+1)-width/2, height[i+1][j+1]-20);326 Vector v4 = Vector (widthX*(i), widthY*(j+1)-width/2, height[i][j+1]-20);322 Vector v1 = Vector (widthX*(i), height[i][j]-20, widthZ*(j) -width/2); 323 Vector v2 = Vector (widthX*(i+1), height[i+1][j]-20, widthZ*(j) -width/2); 324 Vector v3 = Vector (widthX*(i+1), height[i+1][j+1]-20, widthZ*(j+1)-width/2); 325 Vector v4 = Vector (widthX*(i), height[i][j+1]-20, widthZ*(j+1)-width/2); 327 326 float a[3]; 328 327 if(height[i][j]<snowheight){
Note: See TracChangeset
for help on using the changeset viewer.