Changeset 6730 in orxonox.OLD for branches/height_map_merge/src/lib/graphics/importer
- Timestamp:
- Jan 25, 2006, 6:20:55 PM (19 years ago)
- Location:
- branches/height_map_merge/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/height_map_merge/src/lib/graphics/importer/height_map.cc
r6727 r6730 129 129 model->addNormal(normalVectorField[i][w].y,normalVectorField[i][w].z,normalVectorField[i][w].x); 130 130 model->addTexCoor((float)(j1-sampleRate) /(texRate), (float)(i %heightMap->h)/(texRate)); 131 PRINTF(0)("shiftX %f,shiftY %f,shiftZ %f\n", shiftX, shiftY ,shiftZ); 131 132 model->addColor(r/255.0,g/255.0,b/255.0); 132 133 … … 406 407 407 408 heights = (unsigned char*) heightMap->pixels; 408 409 409 shiftX = 0; 410 shiftY = 0; 411 shiftZ = 0; 410 412 } 411 413 HeightMap::~HeightMap() … … 520 522 521 523 522 int xInt = (int)x / scaleX; x -= (float)xInt*scaleX; xInt = heightMap->h - xInt; 523 int yInt = (int)y / scaleZ; y -= (float)yInt*scaleZ; /*yInt = heightMap->w - yInt;*/ 524 525 if(xInt <= 0 || xInt >= heightMap->h || yInt <= 0 || yInt >= heightMap->w ) return shiftY; 524 int xInt = (int)x / scaleX; x -= (float)((int)x); xInt = heightMap->h - xInt; 525 int yInt = (int)y / scaleZ; y -= (float) ((int) y); /*yInt = heightMap->w - yInt;*/ 526 527 PRINTF(0)("xInt: %i, yInt: %i, x: %f, y: %f\n", xInt, yInt, x, y); 528 529 if(xInt <= 0 || xInt >= heightMap->h || yInt <= 0 || yInt >= heightMap->w ) return 0; 526 530 527 531 float height = heights[yInt + (xInt)*heightMap->w]*scaleY; 528 532 533 /* 529 534 float a = normalVectorField[(xInt)][yInt].x; 530 535 float b = normalVectorField [(xInt)][yInt].z; 531 536 float c = normalVectorField [(xInt)][yInt].y; 532 537 533 height -= ( (a/c)*(x) + (b/c)*(y); 534 538 height -= ( (a/c)*(x) + (b/c)*(y)); 539 */ 540 PRINTF(0)("height: %f \n" ,height ); 535 541 return (height ); 536 542 } -
branches/height_map_merge/src/lib/graphics/importer/height_map.h
r6727 r6730 19 19 #define texRate 32 20 20 #define texRatef 4.0f 21 #define tileSize 12821 #define tileSize 32 22 22 23 23 class SDL_Surface;
Note: See TracChangeset
for help on using the changeset viewer.