Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3760 in orxonox.OLD for orxonox/branches/shadows/src/world.cc


Ignore:
Timestamp:
Apr 8, 2005, 9:17:04 AM (19 years ago)
Author:
dave
Message:

branches/shadows: chaos, aber kommt der loesung naeher

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/shadows/src/world.cc

    r3737 r3760  
    294294           
    295295            this->shadow =new Shadow(myPlayer->model,(Player*)myPlayer);           
    296             shadow->init();                 
     296            //shadow->init();     
     297            first=true;             
    297298           
    298299            //create skysphere
     
    383384  // initialize debug coord system
    384385 
    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   
    386397 
    387398 
     
    393404  // Setting the illumination mode otherwise it is flat-shaded.
    394405  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 Textures
    403   glEnable(GL_TEXTURE_2D);
    404  
    405   // Selecting the new Ground Material.
    406406  boden->select();
    407  
    408  
    409  
    410  
    411  
    412  
    413407  int sizeX = 100;
    414408  int sizeZ = 80;
     
    418412  float widthZ = float (width /sizeZ);
    419413 
    420   float height [sizeX][sizeZ];
     414  float
     415 
     416  height [sizeX][sizeZ];
    421417  Vector normal_vectors[sizeX][sizeZ];
    422418  Vector vertexes[sizeX][sizeZ];
     
    459455        shadow->setNormal(normal_vectors[i][j],i,j);
    460456      }
    461 
    462  
     457     
     458     
     459       
    463460  for ( int i = 0; i<sizeX; i+=1)
    464461    for (int j = 0; j<sizeZ;j+=1)
    465462      {   
    466         Vector v1 = Vector (widthX*(i),      height[i][j]-20,       widthZ*(j)  -width/2);
     463        Vector v1 = Vector (widthX*(i),      height[i][j]-20,       widthZ*(j)  -width/2);
    467464        Vector v2 = Vector (widthX*(i+1),    height[i+1][j]-20,     widthZ*(j)  -width/2);
    468465        Vector v3 = Vector (widthX*(i+1),    height[i+1][j+1]-20,   widthZ*(j+1)-width/2);
    469466        Vector v4 = Vector (widthX*(i),      height[i][j+1]-20,     widthZ*(j+1)-width/2);
    470467        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;
    474471        glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
    475472        shadow->setVertexNum(v1,i,j,0);
     
    478475        shadow->setVertexNum(v4,i,j,3);
    479476       
    480        
    481                
     477                       
    482478       
    483479        glNormal3f(normal_vectors[i][j].x, normal_vectors[i][j].y, normal_vectors[i][j].z);
     
    502498       
    503499      }
     500      if(first){
     501        shadow->createGroundList();
     502        first=false;
     503        }
     504       
    504505  glEnd();
    505506 
     
    526527  delete trackManager;
    527528   
    528   glEndList(); 
    529   shadow->init();
     529  glEndList();
     530 shadow->init(); 
     531 
    530532}
    531533
Note: See TracChangeset for help on using the changeset viewer.