Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6730 in orxonox.OLD


Ignore:
Timestamp:
Jan 25, 2006, 6:20:55 PM (19 years ago)
Author:
bottac
Message:
 
Location:
branches/height_map_merge/src
Files:
3 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;
  • branches/height_map_merge/src/world_entities/terrain.cc

    r6727 r6730  
    223223
    224224  /* translate */
    225  /* glTranslatef (this->getAbsCoor ().x,
     225  glTranslatef (this->getAbsCoor ().x,
    226226                this->getAbsCoor ().y,
    227227                this->getAbsCoor ().z);
    228         */     
    229228  /* rotate */
    230229 // Vector tmpRot = this->getAbsDir().getSpacialAxis();
     
    250249  glPopMatrix();
    251250
     251 
     252 
     253 
     254 
    252255 glMatrixMode(GL_MODELVIEW);
    253256glPushMatrix();
Note: See TracChangeset for help on using the changeset viewer.