Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6888 in orxonox.OLD for trunk/src/lib/graphics


Ignore:
Timestamp:
Jan 31, 2006, 4:38:57 AM (19 years ago)
Author:
patrick
Message:

trunk: the flare now look good, but occlusion culling missing :D Lenseflare will be displayed also if the sun is not visible

Location:
trunk/src/lib/graphics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/effects/lense_flare.cc

    r6887 r6888  
    5454  this->flareMatrix[6] = 0.125f; this->flareMatrix[7] = 1.0f;
    5555  this->flareMatrix[8] = -0.5f; this->flareMatrix[9] = 0.5f;
    56   this->flareMatrix[10] = -0.25f; this->flareMatrix[11] = 0.25f;
    57   this->flareMatrix[12] = 1.82f; this->flareMatrix[13] = 0.25f;
     56  this->flareMatrix[10] = -0.25f; this->flareMatrix[11] = 0.15f;
     57  this->flareMatrix[12] = -1.82f; this->flareMatrix[13] = 0.25f;
    5858
    5959  this->lightSource = (LightManager::getInstance())->getLight(0);
     
    178178  this->screenCenter = Vector(State::getResX()/2.0f, State::getResY()/2.0f, 0.0f);
    179179  // flare vector is the direction from the center to the light source
    180   this->flareVector = this->screenCenter - this->flares[0]->getAbsCoor2D();
     180  this->flareVector = this->flares[0]->getAbsCoor2D() - this->screenCenter;
     181  this->flareVector.z = 0.0f;
    181182  this->distance = this->flareVector.len();
    182183  this->flareVector.normalize();
     
    190191    if( i == 0)
    191192      continue;
     193    PRINTF(0)("calculus: (%f %f %f) * %f * %f\n", this->flareVector.x, this->flareVector.y, this->flareVector.z, this->flareMatrix[i * 2], this->distance);
    192194    (*it)->setAbsCoor2D( this->screenCenter + this->flareVector * this->flareMatrix[i * 2] * this->distance);
     195    (*it)->setSize2D(50.0f * this->flareMatrix[i * 2 + 1], 50.0f * this->flareMatrix[i * 2 + 1]);
    193196    PRINTF(5)("Tick flare %i @ (%f, %f)\n", i, (*it)->getAbsCoor2D().x, (*it)->getAbsCoor2D().y);
    194197    // tick them
  • trunk/src/lib/graphics/graphics_engine.cc

    r6885 r6888  
    176176  this->loadGraphicsEffect(ge);
    177177
     178  ge->addFlare("pictures/lense_flare/lens1.png"); //sun
     179  ge->addFlare("pictures/lense_flare/lens2.png"); //first halo
     180  ge->addFlare("pictures/lense_flare/lens1.png"); //small birst
     181  ge->addFlare("pictures/lense_flare/lens3.png"); //second halo
     182  ge->addFlare("pictures/lense_flare/lens4.png");
    178183  ge->addFlare("pictures/lense_flare/lens1.png");
    179   ge->addFlare("pictures/lense_flare/lens2.png");
    180184  ge->addFlare("pictures/lense_flare/lens3.png");
    181   ge->addFlare("pictures/lense_flare/lens4.png");
    182185
    183186  ge->activate();
Note: See TracChangeset for help on using the changeset viewer.