Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 21, 2005, 2:22:59 PM (18 years ago)
Author:
bottac
Message:

getHeight implemented
support for 'colour maps'

File:
1 edited

Legend:

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

    r6103 r6227  
    3030
    3131using namespace std;
     32HeightMap * hm;
    3233
    3334CREATE_FACTORY(Terrain, CL_TERRAIN);
     
    4142  this->init();
    4243
    43   this->tmp_mat = new Material(); 
     44  this->tmp_mat = new Material();
     45  tmp_mat->setTransparency(1.0);
     46  tmp_mat->setIllum(0.3);
     47/*  tmp_mat->setDiffuse(0.55,0.4,0.2);
     48  tmp_mat->setAmbient(0.6,0.4,0.2);
     49  tmp_mat->setSpecular(0.02,0.02,0.02);*/
     50    tmp_mat->setDiffuse(1.0,1.0,1.0);
     51  tmp_mat->setAmbient(1.0,1.0,1.0 );
     52  tmp_mat->setSpecular(1.0,1.0,1.0);
     53  tmp_mat->setShininess(.1);
     54  tmp_mat->setTransparency(1.0);
     55
     56  tmp_mat->diffuseTexture = NULL;
     57  tmp_mat->ambientTexture = NULL;
     58 // tmp_mat->specularTexture = NULL;
     59 
    4460  // this->loadParams(root);
    4561
    4662 char* heightmapName = ResourceManager::getFullName("pictures/heightmapHello.bmp");
    47  HeightMap * hm = new HeightMap(heightmapName);
    48 
     63 char* colourmapName = ResourceManager::getFullName("pictures/heightmapHelloCM.bmp");
     64 hm = new HeightMap(heightmapName, colourmapName);
     65 hm->scale(Vector(23.0f,1.7f,23.0f));
    4966 hm->load();
    5067 this->model=hm;
     
    201218
    202219  /* translate */
    203   glTranslatef (this->getAbsCoor ().x,
    204                 this->getAbsCoor ().y,
    205                 this->getAbsCoor ().z);
     220  glTranslatef (this->getAbsCoor ().x - 1000,
     221                this->getAbsCoor ().y - 400,
     222                this->getAbsCoor ().z - 1000)   ;
    206223  /* rotate */
    207224  Vector tmpRot = this->getAbsDir().getSpacialAxis();
    208225  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    209 
    210    this->tmp_mat->select();
    211 
    212   this->model->draw();
    213   if (this->objectList)
     226       
     227   //this->tmp_mat->select();
     228       
     229
     230  hm->draw();
     231 /* if (this->objectList)
    214232    glCallList(this->objectList);
    215233  else if (this->model)
     
    217235  if (this->vegetation)
    218236    this->vegetation->draw();
     237*/
    219238  glPopMatrix();
    220239
Note: See TracChangeset for help on using the changeset viewer.