Changeset 5980 in orxonox.OLD for branches/height_map
- Timestamp:
- Dec 7, 2005, 9:52:29 PM (19 years ago)
- Location:
- branches/height_map/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/height_map/src/lib/graphics/importer/height_map.cc
r5976 r5980 62 62 if(heightMap != NULL /* && heightMap->format->BitsPerPixel == 8 */) 63 63 { 64 SDL_LockSurface(heightMap);65 for(int i = 0 ; i < heightMap->h -1; i += 2)64 SDL_LockSurface(heightMap); 65 for(int i = 0 ; i < heightMap->h ; i ++) 66 66 { 67 for(int j = 0; j < heightMap->w -1; j += 2)67 for(int j = 0; j < heightMap->w ; j += 1) 68 68 { 69 69 … … 72 72 73 73 74 offset = bmp[j + i*heightMap->w]; 75 height = heightMap->format->palette->colors[offset].r + heightMap->format->palette->colors[offset].g + heightMap->format->palette->colors[offset].b ; 74 offset = bmp[j + i*(heightMap->w )]; 75 height = (unsigned int)heightMap->format->palette->colors[offset].r + 76 (unsigned int)heightMap->format->palette->colors[offset].g + 77 (unsigned int) heightMap->format->palette->colors[offset].b ; 76 78 77 this->addVertex(heightMap->h - i , ((long)( height) / 30) - 60 ,heightMap->w - j); 79 80 this->addVertex( 10*(heightMap->h - i) , (( height)/15) - 200 ,10*j); 78 81 } 79 82 } 80 83 SDL_UnlockSurface(heightMap); 81 for(int i = 0; i < (heightMap->h * heightMap->w)/4 -1 ; i ++) 84 85 int c = (heightMap->w) / 1; 86 int g = 0; 87 88 for(int i = 0; i < (heightMap->w)/1 -1 ; i ++) 82 89 { 83 this->addFace (3, VERTEX_ONLY, i,i+1 ,i + (heightMap->w / 2) ); 90 for(int j = 0; j < (heightMap->h)/1 - 1; j++) 91 { 92 //this->addFace (3, VERTEX_ONLY,j+1+i*c ,j + (i+1)*c, j + i*c ); 84 93 85 this->addFace (3, VERTEX_ONLY,i + (heightMap->w / 2) ,i + (heightMap->w / 2) +1, i+1 ); 94 //this->addFace (3, VERTEX_ONLY,j + (i+1)*c +1 ,j + (i+1)*c,j+i*c +1 ); 95 this->addFace (4 ,VERTEX_ONLY,j+i*c,j+(i+1)*c ,j + (i+1)*c +1, j +i*c+1 ); 96 } 86 97 87 88 //this->addFace (4 ,VERTEX_ONLY,i,i + (heightMap->w / 2) ,i + (heightMap->w / 2) +1, i+1 );98 99 89 100 } 90 101 -
branches/height_map/src/world_entities/player.cc
r5940 r5980 277 277 /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */ 278 278 /* calculate the direction in which the craft is heading */ 279 Vector direction ( 1.0, 0.0, 0.0);279 Vector direction (20.0, 0.0, 0.0); 280 280 //direction = this->absDirection.apply (direction); 281 281 Vector orthDirection (0.0, 0.0, 1.0); … … 289 289 if( this->bLeft ) 290 290 { 291 accel -=(orthDirection) ;291 accel -=(orthDirection)*20; 292 292 rot +=Vector(1,0,0); 293 293 rotVal -= .4; … … 295 295 if( this->bRight ) 296 296 { 297 accel += orthDirection ;297 accel += orthDirection*20; 298 298 rot += Vector(1,0,0); 299 299 rotVal += .4;
Note: See TracChangeset
for help on using the changeset viewer.