Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6579 in orxonox.OLD for branches/height_map_merge/src/world_entities


Ignore:
Timestamp:
Jan 18, 2006, 3:55:37 PM (19 years ago)
Author:
bottac
Message:

HeightMap may now be loaded from a .oxw .

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/height_map_merge/src/world_entities/terrain.cc

    r6496 r6579  
    4343  this->loadParams(root);
    4444
     45   this->heightMapMaterial = new Material();
     46   heightMapMaterial->setTransparency(1.0);
     47   heightMapMaterial->setIllum(0.2);
     48
     49   heightMapMaterial->setDiffuse(1.0,1.0,1.0);
     50   heightMapMaterial->setAmbient(1.0,1.0,1.0 );
     51   heightMapMaterial->setSpecular(1.0,1.0,1.0);
     52   heightMapMaterial->setShininess(.5);
     53   heightMapMaterial->setTransparency(1.0);
     54
     55   heightMapMaterial->diffuseTexture = NULL;
     56   heightMapMaterial->ambientTexture = NULL;
     57   heightMapMaterial->specularTexture = NULL;
     58 
     59   const  char* texture_name = "pictures/ground.tga";
     60   heightMapMaterial->setDiffuseMap(texture_name);
     61   heightMapMaterial->setAmbientMap(texture_name);
     62   heightMapMaterial->setSpecularMap(texture_name);     
     63   
    4564//  if (this->model != NULL)
    4665    //this->ssp = new SpatialSeparation((Model*)this->model, 10.0f);
     
    135154
    136155  this->heightMap = new HeightMap(hmName, hmColorName);
     156  heightMap->scale(Vector(23.0f,3.5f,23.0f));
     157  heightMap->shift(Vector(-1000.0,-90.0,-4000.0));
     158  heightMap->load();
    137159  delete[] hmName;
    138160  delete[] hmColorName;
     
    187209    this->vegetation->draw();
    188210
    189   if(this->heightMap != NULL)
    190     this->heightMap->draw();
     211  if(this->heightMap)
     212        {
     213        this->heightMapMaterial->select();
     214       
     215   
     216        // glEnable(GL_LIGHTING);
     217        glColorMaterial ( GL_FRONT_AND_BACK, GL_EMISSION ) ;
     218        glEnable (GL_COLOR_MATERIAL) ;
     219        this->heightMap->draw();
     220        }
    191221  glPopMatrix();
    192222
Note: See TracChangeset for help on using the changeset viewer.