Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 18, 2006, 5:45:24 PM (18 years ago)
Author:
bottac
Message:

Improved texturemapping

File:
1 edited

Legend:

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

    r6579 r6603  
    167167  if (this->heightMapMaterial != NULL)
    168168    delete this->heightMapMaterial;
     169
     170
     171   this->heightMapMaterial = new Material();
     172   heightMapMaterial->setTransparency(1.0);
     173   heightMapMaterial->setIllum(0.2);
     174
     175   heightMapMaterial->setDiffuse(1.0,1.0,1.0);
     176   heightMapMaterial->setAmbient(1.0,1.0,1.0 );
     177   heightMapMaterial->setSpecular(1.0,1.0,1.0);
     178   heightMapMaterial->setShininess(.5);
     179   heightMapMaterial->setTransparency(1.0);
     180
     181   heightMapMaterial->diffuseTexture = NULL;
     182   heightMapMaterial->ambientTexture = NULL;
     183   heightMapMaterial->specularTexture = NULL;
     184 
     185   
     186   heightMapMaterial->setDiffuseMap(textureName);
     187   heightMapMaterial->setAmbientMap(textureName);
     188   heightMapMaterial->setSpecularMap(textureName);     
     189 
     190
     191
    169192}
    170193
     
    212235        {
    213236        this->heightMapMaterial->select();
    214        
     237        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
     238        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
    215239   
    216         // glEnable(GL_LIGHTING);
     240        glEnable(GL_LIGHTING);
    217241        glColorMaterial ( GL_FRONT_AND_BACK, GL_EMISSION ) ;
    218242        glEnable (GL_COLOR_MATERIAL) ;
Note: See TracChangeset for help on using the changeset viewer.