Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6012 in orxonox.OLD for trunk/src/lib/graphics/importer


Ignore:
Timestamp:
Dec 10, 2005, 5:50:35 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: vertex_array_model is way better now :)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/vertex_array_model.cc

    r6010 r6012  
    5555    PRINT(4)("\n");
    5656  }
    57   this->cleanup();
    5857}
    5958
     
    9190  glTexCoordPointer(2, GL_FLOAT, 0, this->texCoords.getArray()); 
    9291
     92  printf("%d\n", this->indices.getCount());
    9393  glDrawElements(GL_TRIANGLE_STRIP,
    9494                 this->indices.getCount(),
     
    190190 *  reads and includes the Faces/Materials into the openGL state Machine
    191191*/
    192 bool VertexArrayModel::importToVertexArray()
     192void VertexArrayModel::importToVertexArray()
    193193{
    194194  // finalize the Arrays
     
    196196  this->texCoords.finalizeArray();
    197197  this->normals.finalizeArray();
    198 
    199 
    200   glEnableClientState(GL_VERTEX_ARRAY);
    201   glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    202   glEnableClientState(GL_NORMAL_ARRAY);
     198  this->indices.finalizeArray();
     199
     200  //  glEnableClientState(GL_VERTEX_ARRAY);
     201  //  glEnableClientState(GL_TEXTURE_COORD_ARRAY);
     202  //  glEnableClientState(GL_NORMAL_ARRAY);
    203203  //  glEnableClientState(GL_INDEX_ARRAY);
    204 
    205   glVertexPointer(3, GL_FLOAT, 0, this->vertices.getArray());
    206   glNormalPointer(GL_FLOAT, 0, this->normals.getArray());
    207   glTexCoordPointer(2, GL_FLOAT, 0, this->texCoords.getArray());
    208204}
    209205
     
    225221      for (j = 0; j < 20; j++)
    226222        {
    227           this->addVertex(i, i-10*j-10, j);
    228           this->addNormal(i-10, 1, j-10);
     223          this->addVertex(i* 50, .5, (j)*50);
     224          this->addNormal(0, 1, 0);
    229225          this->addTexCoor((float)i/20.0, (float)j/20.0);
    230226
  • trunk/src/lib/graphics/importer/vertex_array_model.h

    r6010 r6012  
    4444
    4545 private:
    46   bool importToVertexArray();
    47 
    48   bool cleanup();
     46  void importToVertexArray();
    4947
    5048 private:
Note: See TracChangeset for help on using the changeset viewer.