Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6181 in orxonox.OLD for branches


Ignore:
Timestamp:
Dec 20, 2005, 3:45:53 AM (19 years ago)
Author:
patrick
Message:

christmas: alternative draw funciton

Location:
branches/christmas_branche/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/christmas_branche/src/lib/graphics/importer/md2Model.cc

    r6180 r6181  
    177177{
    178178  glPushMatrix();
    179   this->renderFrame();
     179//   this->renderFrame();
     180  renderFrameTriangles();
    180181  glPopMatrix();
    181182}
     
    223224  glPopAttrib();
    224225}
     226
     227
     228
     229
     230
     231void MD2Model::renderFrameTriangles() const
     232{
     233  static sVec3D verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */
     234  int* pCommands = this->data->pGLCommands;
     235  /* some face culling stuff */
     236//   glPushAttrib(GL_POLYGON_BIT);
     237//   glFrontFace(GL_CW);
     238//   glEnable(GL_CULL_FACE);
     239//   glCullFace(GL_BACK);
     240
     241//   this->processLighting();
     242//   this->interpolate(/*verticesList*/);
     243  this->data->material->select();
     244
     245  /* draw the triangles */
     246  glBegin(GL_TRIANGLES);
     247
     248  for( int i = 0, k = 0; i < this->data->numTriangles; ++i, k += 3)
     249  {
     250    //printf("%i: (%f, %f)\n", i, (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].s, (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].t);
     251
     252    glTexCoord2f((float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[0]].s,
     253                  (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[0]].t);
     254 //glNormal3f(Md2Model.normal[i].x, Md2Model.normal[i].y, Md2Model.normal[i].z);
     255    glVertex3fv(this->data->pVertices[this->data->pTriangles[i].indexToVertices[0]]);
     256
     257    glTexCoord2f((float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[1]].s,
     258                  (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[1]].t);
     259
     260 //    glNormal3f(Md2Model.normal[i].x, Md2Model.normal[i].y, Md2Model.normal[i].z);
     261    glVertex3fv(this->data->pVertices[this->data->pTriangles[i].indexToVertices[1]]);
     262
     263    glTexCoord2f((float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].s,
     264                  (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].t);
     265 //    glNormal3f(Md2Model.normal[i].x, Md2Model.normal[i].y, Md2Model.normal[i].z);
     266    glVertex3fv(this->data->pVertices[this->data->pTriangles[i].indexToVertices[2]]);
     267  }
     268
     269  glEnd();
     270}
     271
     272
     273
     274
     275
     276
     277
     278
     279
     280
     281
    225282
    226283
  • branches/christmas_branche/src/lib/graphics/importer/md2Model.h

    r6180 r6181  
    214214
    215215  virtual void draw() const;
     216  void renderFrameTriangles() const;
     217
    216218
    217219  void setAnim(int type);
  • branches/christmas_branche/src/world_entities/creatures/md2_creature.cc

    r6180 r6181  
    9393  cannon->setName("BFG");
    9494
    95   //this->getWeaponManager()->addWeapon(wpLeft, 1, 0);
    96   //this->getWeaponManager()->addWeapon(wpRight,1 ,1);
    97   //this->getWeaponManager()->addWeapon(cannon, 0, 6);
     95//   this->getWeaponManager()->addWeapon(wpLeft, 1, 0);
     96//   this->getWeaponManager()->addWeapon(wpRight,1 ,1);
     97//   this->getWeaponManager()->addWeapon(cannon, 0, 6);
    9898
    9999  //this->getWeaponManager()->addWeapon(turret, 3, 0);
     
    111111  this->setClassID(CL_MD2_CREATURE, "MD2Creature");
    112112
    113   PRINTF(4)("SPACESHIP INIT\n");
     113  PRINTF(4)("MD2CREATURE INIT\n");
    114114
    115115  EventHandler::getInstance()->grabEvents(true);
     
    247247void MD2Creature::tick (float time)
    248248{
    249 
    250249  if( likely(this->getModel(0) != NULL))
    251250    ((MD2Model*)this->getModel(0))->tick(time);
     
    289288  this->weaponAction();
    290289}
     290
    291291
    292292/**
Note: See TracChangeset for help on using the changeset viewer.