Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Nov 12, 2004, 1:06:13 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/importer: added TexCoord to readIn

Location:
orxonox/trunk/importer
Files:
2 edited

Legend:

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

    r2804 r2820  
    7676  vertices = new Array();
    7777  normals = new Array();
     78  vTexture = new Array();
    7879  while(!OBJ_FILE->eof())
    7980    {
     
    114115      else if (!strncmp(Buffer, "vt ", 2))
    115116      {
    116         //      printf ("verticeTangent found");
     117        readVertexTexture(Buffer+3);
    117118      }
    118119         
     
    149150      normals->finalizeArray();
    150151      glNormalPointer(GL_FLOAT, 0, normals->getArray());
     152      vTexture->finalizeArray();
    151153    }
    152154
     
    208210  //glArrayElement(atoi(vertex)-1);
    209211  glNormal3fv(normals->getArray() +(atoi(normal)-1)*3);
     212  glTexCoord2fv(vTexture->getArray()+(atoi(texture)-1)*2);
    210213  glVertex3fv(vertices->getArray() +(atoi(vertex)-1)*3);
    211214
     
    225228}
    226229
     230bool Object::readVertexTexture (char* vTextureString)
     231{
     232  readVertices = true;
     233  char subbuffer1[20];
     234  char subbuffer2[20];
     235  sscanf (vTextureString, "%s %s", subbuffer1, subbuffer2);
     236  if (verbose >=3 )
     237    printf("found vertex-Texture %s, %s\n", subbuffer1,subbuffer2);
     238  vTexture->addEntry(atof(subbuffer1));
     239  vTexture->addEntry(atof(subbuffer2));
     240  return true;
     241}
     242
     243
    227244bool Object::readMtlLib (char* mtlFile)
    228245{
  • orxonox/trunk/importer/object.h

    r2804 r2820  
    3232  Array* colors;
    3333  Array* normals;
     34  Array* vTexture;
    3435  char* objFileName;
    3536  char* mtlFileName;
     
    4546  bool readVT (char* vtString);
    4647  bool readVertexNormal (char* normalString);
     48  bool readVertexTexture (char* vTextureString);
    4749  bool readMtlLib (char* matFile);
    4850  bool readUseMtl (char* mtlString);
Note: See TracChangeset for help on using the changeset viewer.