Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6745 in orxonox.OLD


Ignore:
Timestamp:
Jan 25, 2006, 11:07:31 PM (18 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

    r6730 r6745  
    411411  shiftZ = 0;
    412412}
     413
     414
    413415HeightMap::~HeightMap()
    414416{
     
    505507 scaleY = v.y;
    506508 scaleZ = v.z;
     509 generateNormalVectorField();
    507510}
    508511
     
    518521{
    519522
    520  //x -= offsetX;
    521  //y -= offsetZ;
     523 x -= offsetX;
     524 y -= offsetZ;
    522525 
    523526 
     
    531534 float height = heights[yInt + (xInt)*heightMap->w]*scaleY;
    532535 
    533  /*
     536 
    534537 float a = normalVectorField[(xInt)][yInt].x;
    535538 float b = normalVectorField [(xInt)][yInt].z;
    536539 float c = normalVectorField [(xInt)][yInt].y;
    537540 
    538  height -= ( (a/c)*(x) + (b/c)*(y));
    539   */
     541 PRINTF(0)("a: %f \n" ,a);
     542  PRINTF(0)("b: %f \n" ,b);
     543   PRINTF(0)("c: %f \n" ,c);
     544 
     545 height += ( (a/c)*(x) + (b/c)*(y));
     546 
    540547 PRINTF(0)("height: %f \n" ,height );
    541  return (height );
    542 }
     548 return (height + offsetZ);
     549}
  • branches/height_map_merge/src/lib/graphics/importer/height_map.h

    r6730 r6745  
    1919#define texRate      32
    2020#define texRatef     4.0f
    21 #define tileSize     32
     21#define tileSize     64
    2222
    2323class SDL_Surface;
  • branches/height_map_merge/src/world_entities/terrain.cc

    r6730 r6745  
    170170      delete this->heightMapMaterial;
    171171
    172 
     172delete this->heightMapMaterial;
     173/*   
    173174   this->heightMapMaterial = new Material();
    174175   heightMapMaterial->setTransparency(1.0);
     
    190191   heightMapMaterial->setSpecularMap(textureName);     
    191192 
    192 
     193*/
    193194
    194195}
     
    262263    glBegin(GL_QUADS);            // Draw The Cube Using quads
    263264    glColor3f(0.0f,1.0f,0.0f);  // Color Blue
    264     glVertex3f(camera.x + 13.0f,height+13.0f,camera.z-13.0f);      // Top Right Of The Quad (Top)
    265     glVertex3f(camera.x-13.0f, height+13.0f,camera.z-13.0f);      // Top Left Of The Quad (Top)
    266     glVertex3f(camera.x-13.0f, height+13.0f, camera.z+13.0f);      // Bottom Left Of The Quad (Top)
    267     glVertex3f(camera.x+ 13.0f, height+13.0f, camera.z+13.0f);      // Bottom Right Of The Quad (Top)
     265    glVertex3f(camera.x + 63.0f,heightMap->getHeight(camera.x+63.0f, camera.z-10.0f)+13.0f,camera.z-10.0f);      // Top Right Of The Quad (Top)
     266    glVertex3f(camera.x-63.0f, heightMap->getHeight(camera.x+63.0f, camera.z-10.0f)+13.0f,camera.z-10.0f);      // Top Left Of The Quad (Top)
     267    glVertex3f(camera.x-63.0f, heightMap->getHeight(camera.x+63.0f, camera.z+10.0f)+13.0f, camera.z+10.0f);      // Bottom Left Of The Quad (Top)
     268    glVertex3f(camera.x+ 63.0f, heightMap->getHeight(camera.x+63.0f, camera.z+10.0f)+13.0f, camera.z+10.0f);      // Bottom Right Of The Quad (Top)
    268269   glEnd();                      // End Drawing The Plan
    269270   
Note: See TracChangeset for help on using the changeset viewer.