Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Dec 27, 2005, 12:53:06 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: any-3D-model to VertexArrayModel works perfectly

File:
1 edited

Legend:

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

    r6310 r6313  
    5252  this->setClassID(CL_MODEL, "VertexArrayModel");
    5353  this->bFinalized = false;
     54
     55    // importing the data to the new Model.
     56  this->newStripe();
     57
     58  for (unsigned int i = 0; i < model.getVertexCount()*3; i+=3)
     59  {
     60    this->addVertex(model.getVertexArray()[i], model.getVertexArray()[i+1], model.getVertexArray()[i+2]);
     61  }
     62  for (unsigned int i = 0; i < model.getVertexCount()*3; i+=3)
     63    this->addColor(model.getVertexArray()[i], model.getVertexArray()[i+1], model.getVertexArray()[i+2]);
     64  for (unsigned int i = 0; i < model.getNormalsCount()*3; i+=3)
     65    this->addNormal(model.getNormalsArray()[i], model.getNormalsArray()[i+1], model.getNormalsArray()[i+2]);
     66//   for (unsigned int i = 0; i < model.getTexCoordCount(); i+=2)
     67//     this->addTexCoor(model.getTexCoordArray()[i], model.getTexCoordArray()[i+1]);
     68  for (unsigned int i = 0; i < model.getVertexCount()*2; i+=2)
     69    this->addTexCoor(1,2);
     70
    5471
    5572  // The acTC object generating this Model. //
     
    6481  actcBeginInput(tc);
    6582  for(unsigned int i = 0; i < model.getTriangleCount(); i++)
     83  {
    6684      actcAddTriangle(tc,
    6785                      model.getTriangles()[i].indexToVertices[0],
    6886                      model.getTriangles()[i].indexToVertices[1],
    6987                      model.getTriangles()[i].indexToVertices[2]);
     88  }
    7089  actcEndInput(tc);
    7190
    72   // importing the data to the new Model.
    73   this->newStripe();
    74 
    75   for (unsigned int i = 0; i < model.getVertexCount(); i+=3)
    76     this->addVertex(model.getVertexArray()[i], model.getVertexArray()[i+1], model.getVertexArray()[i+2]);
    77   for (unsigned int i = 0; i < model.getVertexCount(); i+=3)
    78     this->addColor(model.getVertexArray()[i], model.getVertexArray()[i+1], model.getVertexArray()[i+2]);
    79   for (unsigned int i = 0; i < model.getNormalsCount(); i+=3)
    80     this->addNormal(model.getNormalsArray()[i], model.getNormalsArray()[i+1], model.getNormalsArray()[i+2]);
    81 //   for (unsigned int i = 0; i < model.getTexCoordCount(); i+=2)
    82 //     this->addTexCoor(model.getTexCoordArray()[i], model.getTexCoordArray()[i+1]);
    83   for (unsigned int i = 0; i < model.getVertexCount(); i+=3)
    84     this->addTexCoor(1,2);
    8591
    8692
Note: See TracChangeset for help on using the changeset viewer.