Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3760 in orxonox.OLD


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

branches/shadows: chaos, aber kommt der loesung naeher

Location:
orxonox/branches/shadows/src
Files:
4 edited

Legend:

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

    r3737 r3760  
    8181    glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,SIZE,SIZE,0,GL_RGB,GL_UNSIGNED_BYTE,NULL);
    8282
    83     this->ground_id=glGenLists(1);
    84     glNewList(this->ground_id,GL_COMPILE);
    85    
    86     setGround();
    87    
    88     glEndList();
     83   
    8984   
    9085    this->player_id=glGenLists(1);
     
    9994
    10095}
    101 
     96void Shadow::createGroundList(){
     97     this->ground_id=glGenLists(1);
     98     glNewList(this->ground_id,GL_COMPILE);
     99   
     100     setGround();
     101   
     102     glEndList();
     103
     104}
    102105
    103106void Shadow::createShadow()
     
    260263    //glClearColor(0,0,0,0);
    261264    //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();
    267270   
    268271   
  • orxonox/branches/shadows/src/shadow.h

    r3737 r3760  
    5353        void init();
    5454        void createShadow();
     55        void createGroundList();
    5556        void draw();
    5657        void setGround();
  • 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
  • orxonox/branches/shadows/src/world.h

    r3706 r3760  
    7878  bool bQuitCurrentGame; //!> quit only the current game and return to menu
    7979  bool bPause;
     80  bool first;
    8081
    8182  GLMenuImageScreen* glmis;
Note: See TracChangeset for help on using the changeset viewer.