Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8026 in orxonox.OLD


Ignore:
Timestamp:
May 31, 2006, 2:20:18 PM (18 years ago)
Author:
hdavid
Message:

branches/atmospheric_engine: billboard

Location:
branches/atmospheric_engine/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc

    r7981 r8026  
    3434  billboard = new Billboard(NULL);
    3535  billboard->setTexture("maps/lightning_bolt.png");
    36   //billboard->setSize(50, 50);
     36  billboard->setSize(10, 20);
    3737  //billboard->setAbsCoor2D(10,10);
    3838  //billboard->setVisibility(true);
  • branches/atmospheric_engine/src/world_entities/effects/billboard.cc

    r7981 r8026  
    6363
    6464  this->material = new Material();
    65   //this->setTexture("maps/lightning_bolt.png");
    66   //this->setAbsCoor(0, 0, 0);
     65  this->setAbsCoor(0, 0, 0);
    6766  this->setVisibiliy(true);
    68   this->setSize(10, 10);
     67  this->setSize(5, 5);
    6968}
    7069
     
    9291  this->sizeX = sizeX;
    9392  this->sizeY = sizeY;
     93
     94  PRINTF(0)("sizeX: %f sizeY: %f", sizeX, sizeY);
    9495}
    9596
     
    110111 */
    111112void Billboard::tick(float dt)
    112 {/*
    113   float z = 0.0f;
    114   glReadPixels ((int)this->getAbsCoor2D().x,
    115                  GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2D().y-1,
    116                  1,
    117                  1,
    118                  GL_DEPTH_COMPONENT,
    119                  GL_FLOAT,
    120                  &z);
    121 
    122   GLdouble objX=.0, objY=.0, objZ=.0;
    123   gluUnProject(this->getAbsCoor2D().x,
    124                GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2D().y-1,
    125                .99,  // z
    126                GraphicsEngine::modMat,
    127                GraphicsEngine::projMat,
    128                GraphicsEngine::viewPort,
    129                &objX,
    130                &objY,
    131   &objZ );*/
     113{
    132114}
    133115
     
    144126
    145127  //glTranslatef(this->getAbsCoor().x, this->getAbsCoor().y, this->getAbsCoor().z);
    146   glTranslatef(0,0,0);
     128  //glTranslatef(0,0,0);
    147129  this->material->select();
    148   /*
    149   glBegin(GL_QUADS);
    150   glTexCoord2f(1.0f, 1.0f); glVertex3f(-sizeX/2, -sizeY/2,  0.0f);
    151   glTexCoord2f(0.0f, 1.0f); glVertex3f( sizeX/2, -sizeY/2,  0.0f);
    152   glTexCoord2f(0.0f, 0.0f); glVertex3f( sizeX/2,  sizeY/2,  0.0f);
    153   glTexCoord2f(1.0f, 0.0f); glVertex3f(-sizeX/2,  sizeY/2,  0.0f);
    154   glEnd();
    155   */
    156130 
    157131  const PNode* camera = State::getCameraNode();  //!< @todo MUST be different
     
    167141 
    168142  float radius = 5;
    169   v *= .5 * radius;
    170   h *= .5 * radius;
    171   /*
    172   glBegin(GL_TRIANGLE_STRIP);
    173   glTexCoord2i(1, 1);
    174   glVertex3f(0 - h.x - v.x,
    175              0 - h.y - v.y,
    176              0 - h.z - v.z);
    177   glTexCoord2i(0, 1);
    178   glVertex3f(0 - h.x + v.x,
    179              0 - h.y + v.y,
    180              0 - h.z + v.z);
    181   glTexCoord2i(1, 0);
    182   glVertex3f(0 + h.x - v.x,
    183              0 + h.y - v.y,
    184              0 + h.z - v.z);
    185   glTexCoord2i(0, 0);
    186   glVertex3f(0 + h.x + v.x,
    187              0 + h.y + v.y,
    188              0 + h.z + v.z);
    189 
    190   glEnd();*/
     143  v *= .5 * sizeX;
     144  h *= .5 * sizeY;
    191145 
    192146  glBegin(GL_QUADS);
    193147  glTexCoord2f(0.0f, 0.0f);
    194   glVertex3f(0 - h.x - v.x,
    195               0 - h.y - v.y,
    196               0 - h.z - v.z);
     148  glVertex3f(this->getAbsCoor().x - h.x - v.x,
     149             this->getAbsCoor().y - h.y - v.y,
     150             this->getAbsCoor().z - h.z - v.z);
    197151  glTexCoord2f(1.0f, 0.0f);
    198   glVertex3f( 0 + h.x - v.x,
    199               0 + h.y - v.y,
    200               0 + h.z - v.z);
     152  glVertex3f( this->getAbsCoor().x + h.x - v.x,
     153              this->getAbsCoor().y + h.y - v.y,
     154              this->getAbsCoor().z + h.z - v.z);
    201155  glTexCoord2f(1.0f, 1.0f);
    202   glVertex3f(0 + h.x + v.x,
    203              0 + h.y + v.y,
    204              0 + h.z + v.z);
     156  glVertex3f(this->getAbsCoor().x + h.x + v.x,
     157             this->getAbsCoor().y + h.y + v.y,
     158             this->getAbsCoor().z + h.z + v.z);
    205159  glTexCoord2f(0.0f, 1.0f);
    206   glVertex3f(0 - h.x + v.x,
    207              0 - h.y + v.y,
    208              0 - h.z + v.z);
     160  glVertex3f(this->getAbsCoor().x - h.x + v.x,
     161             this->getAbsCoor().y - h.y + v.y,
     162             this->getAbsCoor().z - h.z + v.z);
    209163  glEnd();
    210164 
Note: See TracChangeset for help on using the changeset viewer.