Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3712 in orxonox.OLD for orxonox/branches/shadows


Ignore:
Timestamp:
Apr 1, 2005, 5:59:36 PM (20 years ago)
Author:
dave
Message:

branches/shadows: ganzes Raumschiff sichtbar, und Schatten schwarz gemacht:)

File:
1 edited

Legend:

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

    r3711 r3712  
    101101void Shadow::createShadow()
    102102{
    103     glViewport(0,0,SIZE,SIZE);
    104     glScissor(0,0,SIZE,SIZE);
     103    glViewport(0,0,2*SIZE,2*SIZE);
     104    glScissor(0,0,2*SIZE,2*SIZE);
    105105    glEnable(GL_SCISSOR_TEST);
    106106    glBindTexture(GL_TEXTURE_2D,this->shadow_id);
     
    110110    glMatrixMode(GL_PROJECTION);
    111111    glLoadIdentity();
    112     glOrtho(-1,1,-1,1,-100,100);
     112    glOrtho(-4.2,4.2,-4.2,4.2,-100,100);
    113113    glMatrixMode(GL_MODELVIEW);
    114114    glLoadIdentity();
     
    116116    gluLookAt(this->lightPos[0],this->lightPos[1],this->lightPos[2],this->playerPos[0],this->playerPos[1],this->playerPos[2],0,0,1);
    117117   
    118     glColor3f(.4,.4,.4);
     118    glColor3f(.1,.1,.1);
    119119    glTranslatef(this->playerPos[0],this->playerPos[1],this->playerPos[2]);
    120120    //die Variable angle ist im Player.h als public definiert!!! deshalb kann
     
    122122    glRotatef(this->playerangle->angle,1.0,0.0,0.0);
    123123   
    124    
     124    //Lighting has to be disabled for the shadow to become nice black respectively grey (color(.1,.1,.1))
     125    glDisable(GL_LIGHTING);
    125126    glCallList(this->player_id);
     127    glEnable(GL_LIGHTING);
     128   
    126129    glColor3f(1,1,1);
    127130    glReadPixels(0,0,SIZE,SIZE,GL_RGB,GL_UNSIGNED_BYTE,this->image);
Note: See TracChangeset for help on using the changeset viewer.