Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 25, 2006, 6:20:55 PM (19 years ago)
Author:
bottac
Message:
 
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  
    129129                model->addNormal(normalVectorField[i][w].y,normalVectorField[i][w].z,normalVectorField[i][w].x);
    130130                model->addTexCoor((float)(j1-sampleRate) /(texRate), (float)(i %heightMap->h)/(texRate));
     131                PRINTF(0)("shiftX %f,shiftY %f,shiftZ %f\n", shiftX, shiftY ,shiftZ);
    131132                model->addColor(r/255.0,g/255.0,b/255.0);
    132133               
     
    406407       
    407408  heights  = (unsigned char*) heightMap->pixels;
    408 
    409 
     409  shiftX = 0;
     410  shiftY = 0;
     411  shiftZ = 0;
    410412}
    411413HeightMap::~HeightMap()
     
    520522 
    521523 
    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;
    526530 
    527531 float height = heights[yInt + (xInt)*heightMap->w]*scaleY;
    528532 
     533 /*
    529534 float a = normalVectorField[(xInt)][yInt].x;
    530535 float b = normalVectorField [(xInt)][yInt].z;
    531536 float c = normalVectorField [(xInt)][yInt].y;
    532537 
    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 );
    535541 return (height );
    536542}
  • branches/height_map_merge/src/lib/graphics/importer/height_map.h

    r6727 r6730  
    1919#define texRate      32
    2020#define texRatef     4.0f
    21 #define tileSize     128
     21#define tileSize     32
    2222
    2323class SDL_Surface;
Note: See TracChangeset for help on using the changeset viewer.