Changeset 3760 in orxonox.OLD for orxonox/branches/shadows/src
- Timestamp:
- Apr 8, 2005, 9:17:04 AM (20 years ago)
- Location:
- orxonox/branches/shadows/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/shadows/src/shadow.cc
r3737 r3760 81 81 glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,SIZE,SIZE,0,GL_RGB,GL_UNSIGNED_BYTE,NULL); 82 82 83 this->ground_id=glGenLists(1); 84 glNewList(this->ground_id,GL_COMPILE); 85 86 setGround(); 87 88 glEndList(); 83 89 84 90 85 this->player_id=glGenLists(1); … … 99 94 100 95 } 101 96 void Shadow::createGroundList(){ 97 this->ground_id=glGenLists(1); 98 glNewList(this->ground_id,GL_COMPILE); 99 100 setGround(); 101 102 glEndList(); 103 104 } 102 105 103 106 void Shadow::createShadow() … … 260 263 //glClearColor(0,0,0,0); 261 264 //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 262 glMatrixMode(GL_PROJECTION);263 glLoadIdentity();264 gluPerspective(45,4.0/3.0,.5,100);265 glMatrixMode(GL_MODELVIEW);266 glLoadIdentity();265 //glMatrixMode(GL_PROJECTION); 266 //glLoadIdentity(); 267 //gluPerspective(45,4.0/3.0,.5,100); 268 //glMatrixMode(GL_MODELVIEW); 269 //glLoadIdentity(); 267 270 268 271 -
orxonox/branches/shadows/src/shadow.h
r3737 r3760 53 53 void init(); 54 54 void createShadow(); 55 void createGroundList(); 55 56 void draw(); 56 57 void setGround(); -
orxonox/branches/shadows/src/world.cc
r3737 r3760 294 294 295 295 this->shadow =new Shadow(myPlayer->model,(Player*)myPlayer); 296 shadow->init(); 296 //shadow->init(); 297 first=true; 297 298 298 299 //create skysphere … … 383 384 // initialize debug coord system 384 385 385 386 objectList = glGenLists(1); 387 glNewList (objectList, GL_COMPILE); 388 glLoadIdentity(); 389 //glColor3f(1.0,0,0); 390 391 // Enabling Textures 392 glEnable(GL_TEXTURE_2D); 393 394 // Selecting the new Ground Material. 395 396 386 397 387 398 … … 393 404 // Setting the illumination mode otherwise it is flat-shaded. 394 405 boden->setIllum(3); 395 396 397 objectList = glGenLists(1);398 glNewList (objectList, GL_COMPILE);399 glLoadIdentity();400 //glColor3f(1.0,0,0);401 402 // Enabling Textures403 glEnable(GL_TEXTURE_2D);404 405 // Selecting the new Ground Material.406 406 boden->select(); 407 408 409 410 411 412 413 407 int sizeX = 100; 414 408 int sizeZ = 80; … … 418 412 float widthZ = float (width /sizeZ); 419 413 420 float height [sizeX][sizeZ]; 414 float 415 416 height [sizeX][sizeZ]; 421 417 Vector normal_vectors[sizeX][sizeZ]; 422 418 Vector vertexes[sizeX][sizeZ]; … … 459 455 shadow->setNormal(normal_vectors[i][j],i,j); 460 456 } 461 462 457 458 459 463 460 for ( int i = 0; i<sizeX; i+=1) 464 461 for (int j = 0; j<sizeZ;j+=1) 465 462 { 466 463 Vector v1 = Vector (widthX*(i), height[i][j]-20, widthZ*(j) -width/2); 467 464 Vector v2 = Vector (widthX*(i+1), height[i+1][j]-20, widthZ*(j) -width/2); 468 465 Vector v3 = Vector (widthX*(i+1), height[i+1][j+1]-20, widthZ*(j+1)-width/2); 469 466 Vector v4 = Vector (widthX*(i), height[i][j+1]-20, widthZ*(j+1)-width/2); 470 467 float a[3]; 471 a[0]= 1.0;472 a[1]= 1.0;473 a[2]= 1.0;468 a[0]=.8; 469 a[1]=.8; 470 a[2]=.8; 474 471 glMaterialfv(GL_FRONT,GL_DIFFUSE,a); 475 472 shadow->setVertexNum(v1,i,j,0); … … 478 475 shadow->setVertexNum(v4,i,j,3); 479 476 480 481 477 482 478 483 479 glNormal3f(normal_vectors[i][j].x, normal_vectors[i][j].y, normal_vectors[i][j].z); … … 502 498 503 499 } 500 if(first){ 501 shadow->createGroundList(); 502 first=false; 503 } 504 504 505 glEnd(); 505 506 … … 526 527 delete trackManager; 527 528 528 glEndList(); 529 shadow->init(); 529 glEndList(); 530 shadow->init(); 531 530 532 } 531 533 -
orxonox/branches/shadows/src/world.h
r3706 r3760 78 78 bool bQuitCurrentGame; //!> quit only the current game and return to menu 79 79 bool bPause; 80 bool first; 80 81 81 82 GLMenuImageScreen* glmis;
Note: See TracChangeset
for help on using the changeset viewer.