Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3073 in orxonox.OLD for orxonox/trunk/importer


Ignore:
Timestamp:
Dec 3, 2004, 11:08:20 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/importer: better numbering (previously it was not clear why you should read vertexNumber -1.

File:
1 edited

Legend:

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

    r3072 r3073  
    479479        }
    480480      if (vertex)
    481         tmpElem->vertexNumber = atoi(vertex);
     481        tmpElem->vertexNumber = atoi(vertex)-1;
    482482      else
    483         tmpElem->vertexNumber = 0;
     483        tmpElem->vertexNumber = -1;
    484484      if (texture)
    485         tmpElem->texCoordNumber = atoi(texture);
     485        tmpElem->texCoordNumber = atoi(texture)-1;
    486486      else
    487         tmpElem->texCoordNumber = 0;
     487        tmpElem->texCoordNumber = -1;
    488488      if (normal)
    489         tmpElem->normalNumber = atoi(normal);
     489        tmpElem->normalNumber = atoi(normal)-1;
    490490      else
    491         tmpElem->normalNumber = 0;
     491        tmpElem->normalNumber = -1;
    492492
    493493      faceString += tmpLen;
     
    756756    printf ("importing grafical Element to openGL.\n");
    757757
    758   if (elem->texCoordNumber)
    759     glTexCoord2fv(vTexture->getArray()+(elem->texCoordNumber-1)*2);
    760   if (elem->normalNumber)
    761     glNormal3fv(normals->getArray() +(elem->normalNumber-1)*3);
    762   if (elem->vertexNumber)
    763     glVertex3fv(vertices->getArray() +(elem->vertexNumber-1)*3);
     758  if (elem->texCoordNumber != -1)
     759    glTexCoord2fv(vTexture->getArray() + elem->texCoordNumber * 2);
     760  if (elem->normalNumber != -1)
     761    glNormal3fv(normals->getArray() + elem->normalNumber * 3);
     762  if (elem->vertexNumber != -1)
     763    glVertex3fv(vertices->getArray() + elem->vertexNumber * 3);
    764764
    765765}
Note: See TracChangeset for help on using the changeset viewer.