Changeset 6603 in orxonox.OLD for branches/height_map_merge/src
- Timestamp:
- Jan 18, 2006, 5:45:24 PM (19 years ago)
- Location:
- branches/height_map_merge/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/height_map_merge/src/lib/graphics/importer/height_map.cc
r6579 r6603 54 54 void Tile::draw() 55 55 { 56 lowResModel->draw(); 56 // This Draws the LOD's 57 //FIXME 58 float cameraDistance = (State::getCamera()->getAbsCoor() - Vector(0.0,100.0,0.0)).len(); 59 if (cameraDistance > 5000 ) 60 { 61 62 } 63 else if (cameraDistance > 1000 ) 64 { 65 this->drawLowRes(); 66 } 67 else 68 { 69 this->drawHighRes(); 70 } 57 71 } 58 72 … … 432 446 int j_max= (heightMap->w - tileSize) / tileSize; 433 447 434 // calc i_min , i_max j_min and j_maxt 435 436 int centerX = (int)((heightMap->h - ((v.x - shiftX)/ (float)scaleX ))/ tileSize); 437 int centerY = (int)((v.z - shiftZ)/ (float)scaleZ )/ tileSize; 438 //PRINTF(0)("i_max %i \n" , i_max); 439 //PRINTF(0)("CENTERY %i \n ",centerY ); 440 i_min = max(centerX -1, i_min); 441 i_max = min(centerX +2 , i_max ); 442 443 j_min = max(centerY -1,1); 444 j_max = min(centerY +2, j_max); 445 446 447 for(int i = 1; i < i_min ; i ++) 448 449 450 for(int i = 1; i < i_max ; i ++) 448 451 { 449 452 for(int j = 1; j < j_max ; j++) 450 453 { 451 454 452 tiles[i][j]->draw LowRes();455 tiles[i][j]->draw(); 453 456 } 454 457 } 455 for(int i = i_min; i < i_max ; i ++)456 {457 for(int j = j_min; j < j_max ; j++)458 {459 460 tiles[i][j]->drawHighRes();461 }462 }463 464 for(int i = i_max; i < (heightMap->h -tileSize)/tileSize ; i ++)465 {466 for(int j = 1; j < j_max ; j++)467 {468 469 tiles[i][j]->drawLowRes();470 }471 }472 473 474 for(int i = 1; i < (heightMap->h -tileSize)/tileSize; i++ )475 {476 for(int j = 1; j < j_min; j++)477 {478 tiles[i][j]->drawLowRes();479 }480 }481 for(int i = 1; i < (heightMap->h -tileSize)/tileSize; i++)482 {483 for(int j = j_max; j < (heightMap->w -tileSize)/tileSize; j++ )484 {485 tiles[i][j]->drawLowRes();486 }487 }488 458 489 459 } -
branches/height_map_merge/src/lib/graphics/importer/height_map.h
r6579 r6603 17 17 18 18 19 #define texRate 2219 #define texRate 64 20 20 #define texRatef 4.0f 21 #define tileSize 3221 #define tileSize 64 22 22 23 23 class SDL_Surface; -
branches/height_map_merge/src/lib/graphics/importer/texture.cc
r6465 r6603 264 264 265 265 266 glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_REPEAT);267 glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_REPEAT);266 // glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_REPEAT); 267 // glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_REPEAT); 268 268 269 269 /* control the mipmap levels */ -
branches/height_map_merge/src/lib/graphics/importer/vertex_array_model.cc
r6477 r6603 135 135 void VertexArrayModel::draw() const 136 136 { 137 138 glPushAttrib(GL_ALL_ATTRIB_BITS); 139 glColorMaterial ( GL_FRONT_AND_BACK, GL_EMISSION ) ; 140 glEnable (GL_COLOR_MATERIAL) ; 141 142 137 143 PRINTF(4)("drawing 3D-VertexArrayModel %s\n", this->getName()); 144 138 145 glEnableClientState(GL_VERTEX_ARRAY ); 139 //glEnableClientState(GL_TEXTURE_COORD_ARRAY );146 glEnableClientState(GL_TEXTURE_COORD_ARRAY ); 140 147 glEnableClientState(GL_NORMAL_ARRAY ); 141 148 glEnableClientState(GL_COLOR_ARRAY ); … … 144 151 glVertexPointer(3, GL_FLOAT, 0, &this->vertices[0]); 145 152 glNormalPointer(GL_FLOAT, 0, &this->normals[0]); 146 //glTexCoordPointer(2, GL_FLOAT, 0, &this->texCoords[0]);153 glTexCoordPointer(2, GL_FLOAT, 0, &this->texCoords[0]); 147 154 glColorPointer(3, GL_FLOAT, 0, &this->colors[0]); 155 156 157 148 158 149 159 for (GLuint i = 1; i < this->stripes.size(); ++i) … … 154 164 &this->indices[this->stripes[i-1]] ); 155 165 } 166 167 glPopAttrib(); 156 168 } 157 169 -
branches/height_map_merge/src/world_entities/terrain.cc
r6579 r6603 167 167 if (this->heightMapMaterial != NULL) 168 168 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 169 192 } 170 193 … … 212 235 { 213 236 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); 215 239 216 //glEnable(GL_LIGHTING);240 glEnable(GL_LIGHTING); 217 241 glColorMaterial ( GL_FRONT_AND_BACK, GL_EMISSION ) ; 218 242 glEnable (GL_COLOR_MATERIAL) ;
Note: See TracChangeset
for help on using the changeset viewer.