Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7981 in orxonox.OLD


Ignore:
Timestamp:
May 30, 2006, 3:30:45 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

    r7965 r7981  
    3333 
    3434  billboard = new Billboard(NULL);
    35   //billboard->setTexture("maps/lightning_bolt.png");
     35  billboard->setTexture("maps/lightning_bolt.png");
    3636  //billboard->setSize(50, 50);
    3737  //billboard->setAbsCoor2D(10,10);
     
    5050{
    5151        this->deactivate();
    52   delete billboard;
    5352}
    5453
  • branches/atmospheric_engine/src/world_entities/effects/billboard.cc

    r7965 r7981  
    6363
    6464  this->material = new Material();
    65   this->setTexture("maps/lightning_bolt.png");
    66   this->setAbsCoor(0, 0, 0);
     65  //this->setTexture("maps/lightning_bolt.png");
     66  //this->setAbsCoor(0, 0, 0);
    6767  this->setVisibiliy(true);
    6868  this->setSize(10, 10);
     
    141141    return;
    142142
    143 //PRINTF(0)("draw\n");
    144 
    145143  glPushMatrix();
    146144
     
    148146  glTranslatef(0,0,0);
    149147  this->material->select();
    150 
     148  /*
    151149  glBegin(GL_QUADS);
    152150  glTexCoord2f(1.0f, 1.0f); glVertex3f(-sizeX/2, -sizeY/2,  0.0f);
     
    155153  glTexCoord2f(1.0f, 0.0f); glVertex3f(-sizeX/2,  sizeY/2,  0.0f);
    156154  glEnd();
    157 
     155  */
     156 
     157  const PNode* camera = State::getCameraNode();  //!< @todo MUST be different
     158  Vector cameraPos = camera->getAbsCoor();
     159  Vector cameraTargetPos = State::getCameraTargetNode()->getAbsCoor();
     160  Vector view = cameraTargetPos - cameraPos;
     161  Vector up = Vector(0, 1, 0);
     162  up = camera->getAbsDir().apply(up);
     163  Vector h = up.cross(view);
     164  Vector v = h.cross(view);
     165  h.normalize();
     166  v.normalize();
     167 
     168  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();*/
     191 
     192  glBegin(GL_QUADS);
     193  glTexCoord2f(0.0f, 0.0f);
     194  glVertex3f(0 - h.x - v.x,
     195              0 - h.y - v.y,
     196              0 - h.z - v.z);
     197  glTexCoord2f(1.0f, 0.0f);
     198  glVertex3f( 0 + h.x - v.x,
     199              0 + h.y - v.y,
     200              0 + h.z - v.z);
     201  glTexCoord2f(1.0f, 1.0f);
     202  glVertex3f(0 + h.x + v.x,
     203             0 + h.y + v.y,
     204             0 + h.z + v.z);
     205  glTexCoord2f(0.0f, 1.0f);
     206  glVertex3f(0 - h.x + v.x,
     207             0 - h.y + v.y,
     208             0 - h.z + v.z);
     209  glEnd();
     210 
     211 
    158212  glPopMatrix();
    159213}
Note: See TracChangeset for help on using the changeset viewer.