Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Dec 27, 2005, 2:28:15 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: some new tc-stuff

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

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/Makefile.am

    r6308 r6309  
    22include $(MAINSRCDIR)/defs/include_paths.am
    33
    4 noinst_LIBRARIES = libORXimporter.a
     4noinst_LIBRARIES = libORXimporter.a libtc.a
    55
    66libORXimporter_a_SOURCES = model.cc \
    7                            tc.c \
    87                           vertex_array_model.cc \
    98                           static_model.cc \
     
    1615                           height_map.cc
    1716
     17libtc_a_SOURCES  = tc.c
    1818
    1919
  • trunk/src/lib/graphics/importer/vertex_array_model.cc

    r6308 r6309  
    5252  this->setClassID(CL_MODEL, "VertexArrayModel");
    5353  this->bFinalized = false;
     54
     55  // The acTC object generating this Model. //
     56  ACTCData *tc;
     57  tc = actcNew();
     58  if(tc == NULL) {
     59    /* memory allocation failed */
     60    /* print error here and exit or whatever */
     61  }
     62
     63  // inputing the data of model to the tc
     64  actcBeginInput(tc);
     65  for(unsigned int i = 0; i < model.getTriangleCount(); i++)
     66      actcAddTriangle(tc, model.getTriangles()[i].indexToVertices[0], model.getTriangles()[i].indexToVertices[1], model.getTriangles()[i].indexToVertices[2]);
     67  actcEndInput(tc);
     68
     69  // importing the data to the new Model.
    5470  this->newStripe();
    5571
     
    6177    this->addTexCoor(model.getTexCoordArray()[i], model.getTexCoordArray()[i+1]);
    6278
    63   // The acTC object generating this Model. //
    64   ACTCData *tc;
    65   tc = actcNew();
    66   if(tc == NULL) {
    67     /* memory allocation failed */
    68     /* print error here and exit or whatever */
    69   }
    70 
    71   // inputing the data of model to the tc
    72   actcBeginInput(tc);
    73   for(unsigned int i = 0; i < model.getTriangleCount(); i++)
    74       actcAddTriangle(tc, model.getTriangles()[i].indexToVertices[0], model.getTriangles()[i].indexToVertices[1], model.getTriangles()[i].indexToVertices[2]);
    75   actcEndInput(tc);
    76 
    77   // importing the data to the new Model.
     79
    7880  int prim;
    7981  unsigned int v1, v2, v3;
     
    8486    this->addIndice(v1);
    8587    this->addIndice(v2);
     88    printf("%d\n", v1);
     89    printf("%d\n", v2);
    8690    /* start a primitive of type "prim" with v1 and v2 */
    8791    while(actcGetNextVert(tc, &v3) != ACTC_PRIM_COMPLETE)
     
    8993      /* continue primitive using v3 */
    9094      this->addIndice(v3);
     95      printf("%d\n", v3);
    9196    }
    9297    this->newStripe();
     
    96101  this->finalize();
    97102}
     103
    98104
    99105/**
Note: See TracChangeset for help on using the changeset viewer.