Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3065 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Dec 3, 2004, 2:54:36 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/importer: Material now working.

Location:
orxonox/trunk/importer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/importer/object.cc

    r3064 r3065  
    377377    }
    378378
    379   currentGroup->faceCount++;
     379  currentGroup->faceCount += currentGroup->currentFace->vertexCount -2;
    380380}
    381381
     
    483483  face->firstElem = NULL;
    484484 
    485   face->material = NULL;
     485  face->materialString = NULL;
    486486 
    487487  face->next = NULL;
     
    515515      while (tmpFace != NULL)
    516516        {
    517           if (tmpFace->vertexCount == 3)
     517          if (tmpFace->vertexCount == 0 && tmpFace->materialString != NULL)
     518            {
     519              if (currentGroup->faceMode != -1)
     520                glEnd();
     521              currentGroup->faceMode = 0;
     522              if (verbose >= 2)
     523                printf ("using material %s for coming Faces.\n", tmpFace->materialString);
     524              material->search(tmpFace->materialString)->select();
     525
     526            }
     527
     528          else if (tmpFace->vertexCount == 3)
    518529            {
    519530              if (currentGroup->faceMode != 3)
     
    655666    }
    656667     
    657   if (currentGroup->faceMode != -1)
    658     glEnd();
    659   currentGroup->faceMode = 0;
    660   if (verbose >= 2)
    661     printf ("using material %s for coming Faces.\n", matString);
    662   material->search(matString)->select();
     668  if (currentGroup->faceCount >0)
     669    currentGroup->currentFace = currentGroup->currentFace->next = new Face;
     670  initFace (currentGroup->currentFace);
     671 
     672  currentGroup->currentFace->materialString = new char[strlen(matString)];
     673  strcpy (currentGroup->currentFace->materialString, matString);
     674 
     675  if (currentGroup->faceCount == 0)
     676    currentGroup->faceCount ++;
     677
    663678}
    664679
  • orxonox/trunk/importer/object.h

    r3063 r3065  
    5151    FaceElement* firstElem;
    5252
    53     char* material;
     53    char* materialString;
    5454
    5555    Face* next;
Note: See TracChangeset for help on using the changeset viewer.