Changeset 3405 in orxonox.OLD for orxonox/branches/dave/src
- Timestamp:
- Feb 13, 2005, 9:10:20 PM (20 years ago)
- Location:
- orxonox/branches/dave/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/dave/src/world.cc
r3404 r3405 28 28 #include "helper_parent.h" 29 29 #include "glmenu_imagescreen.h" 30 #include "importer/material.h" 30 31 31 32 using namespace std; … … 372 373 373 374 375 // Initializing the Ground, and loading a Texture into it. 376 Material* boden = new Material("Ground"); 377 boden->setDiffuseMap("../data/pictures/ground.tga"); 378 // Setting the illumination mode otherwise it is flat-shaded. 379 boden->setIllum(3); 380 374 381 objectList = glGenLists(1); 375 382 glNewList (objectList, GL_COMPILE); … … 377 384 //glColor3f(1.0,0,0); 378 385 379 //BodenTextur reinladen 380 Texture* boden=new Texture(); 381 boden->loadImage("../data/pictures/ground.tga"); 382 386 // Enabling Textures 387 glEnable(GL_TEXTURE_2D); 388 389 // Selecting the new Ground Material. 390 boden->select(); 383 391 384 392 … … 453 461 } 454 462 glNormal3f(normal_vectors[i][j].x, normal_vectors[i][j].y, normal_vectors[i][j].z); 455 glTexCoord2f( 0.0f,0.0f);463 glTexCoord2f((float)i/(float)sizeX,(float)j/(float)sizeZ); 456 464 glVertex3f(v1.x, v1.y, v1.z); 465 466 457 467 if(height[i+1][j]<snowheight){ 458 468 a[0]=0; … … 466 476 a[2]=1.0; 467 477 glMaterialfv(GL_FRONT,GL_DIFFUSE,a); 468 469 478 } 470 479 glNormal3f(normal_vectors[i+1][j].x, normal_vectors[i+1][j].y, normal_vectors[i+1][j].z); 471 glTexCoord2f( 1.0f,0.0f);480 glTexCoord2f((float)(i+1.0)/(float)sizeX,(float)j/(float)sizeZ); 472 481 glVertex3f(v2.x, v2.y, v2.z); 482 473 483 if(height[i+1][j+1]<snowheight){ 474 484 a[0]=0; … … 482 492 a[2]=1.0; 483 493 glMaterialfv(GL_FRONT,GL_DIFFUSE,a); 484 485 486 494 } 487 495 glNormal3f(normal_vectors[i+1][j+1].x, normal_vectors[i+1][j+1].y, normal_vectors[i+1][j+1].z); 488 glTexCoord2f( 1.0f,1.0f);496 glTexCoord2f((float)(i+1.0)/(float)sizeX,(float)(j+1.0)/(float)sizeZ); 489 497 glVertex3f(v3.x, v3.y, v3.z); 498 490 499 if(height[i][j+1]<snowheight){ 491 500 a[0]=0; … … 501 510 } 502 511 glNormal3f(normal_vectors[i][j+1].x, normal_vectors[i][j+1].y, normal_vectors[i][j+1].z); 503 glTexCoord2f( 0.0f,1.0f);512 glTexCoord2f((float)(i)/(float)sizeX,(float)(j+1.0)/(float)sizeZ); 504 513 glVertex3f(v4.x, v4.y, v4.z); 505 514 506 515 } 507 516 glEnd(); 517 518 // Disable Textures Again, for Performance reasons. 519 glDisable(GL_TEXTURE_2D); 520 508 521 /* 509 522 glBegin(GL_LINES); -
orxonox/branches/dave/src/world.h
r3403 r3405 10 10 #include "stdincl.h" 11 11 #include "story_entity.h" 12 #include "importer/texture.h" 13 12 class Material; 14 13 15 14
Note: See TracChangeset
for help on using the changeset viewer.