Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3737 in orxonox.OLD for orxonox/branches/shadows/src/shadow.cc


Ignore:
Timestamp:
Apr 6, 2005, 10:56:40 PM (20 years ago)
Author:
dave
Message:

branches/shadows:Das ganze droht nicht fertig zu werden bis Freitag, Erkenntnisse wachsen jedoch:)

File:
1 edited

Legend:

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

    r3728 r3737  
    8484    glNewList(this->ground_id,GL_COMPILE);
    8585   
    86     //blabla
     86    setGround();
    8787   
    8888    glEndList();
     
    130130   
    131131    glColor3f(1,1,1);
    132     glReadPixels(0,0,SIZE,SIZE,GL_RGB,GL_UNSIGNED_BYTE,this->image);
    133     blur(this->image,SIZE);
    134     glTexSubImage2D(GL_TEXTURE_2D,0,0,0,SIZE,SIZE,GL_RGB,GL_UNSIGNED_BYTE,this->image);
     132   
     133    glCopyTexSubImage2D(GL_TEXTURE_2D,0,0,0,0,0,SIZE,SIZE);
     134    //glReadPixels(0,0,SIZE,SIZE,GL_RGB,GL_UNSIGNED_BYTE,this->image);
     135    //blur(this->image,SIZE);
     136    //glTexSubImage2D(GL_TEXTURE_2D,0,0,0,SIZE,SIZE,GL_RGB,GL_UNSIGNED_BYTE,this->image);
    135137   
    136138    glDisable(GL_SCISSOR_TEST);
     
    170172void Shadow::setGround()
    171173{
    172     this->ground_id=glGenLists(1);
    173     glNewList(this->ground_id,GL_COMPILE);
     174   
     175   
    174176    glBegin(GL_QUADS);
    175177    for(int i=0;i<100;i+=1)
     
    190192            }
    191193    glEnd();
    192     glEndList();   
     194       
    193195
    194196
     
    254256{
    255257    float m[16],im[16];
     258   
    256259    createShadow();
    257    
    258260    //glClearColor(0,0,0,0);
    259261    //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    260     //glMatrixMode(GL_PROJECTION);
    261     //glLoadIdentity();
    262     //gluPerspective(45,4.0/3.0,.5,100);
    263     //glMatrixMode(GL_MODELVIEW);
    264     //glLoadIdentity();
    265    
    266     //gluLookAt(this->cameraPos[0],this->cameraPos[1],this->cameraPos[2],this->playerPos[0],this->playerPos[1],this->playerPos[2],0,0,1);
     262    glMatrixMode(GL_PROJECTION);
     263    glLoadIdentity();
     264    gluPerspective(45,4.0/3.0,.5,100);
     265    glMatrixMode(GL_MODELVIEW);
     266    glLoadIdentity();
     267   
     268   
    267269   
    268270    glEnable(GL_TEXTURE_GEN_S);
     
    274276    glMatrixMode(GL_TEXTURE);
    275277    glLoadIdentity();
    276     glTranslatef(0.5,0.5,1.0);
    277     glScalef(0.5,0.5,1.0);
     278    glTranslatef(-.5,.5,0);
     279    glScalef(0.3,0.3,1.0);
    278280    glOrtho(-1,1,-1,1,-1,1);
    279281   
     
    287289    glCallList(this->ground_id);
    288290    glDisable(GL_BLEND);
     291    glDisable(GL_TEXTURE_2D);
    289292   
    290293    glLoadIdentity();
Note: See TracChangeset for help on using the changeset viewer.