Changeset 2820 in orxonox.OLD for orxonox/trunk/importer
- Timestamp:
- Nov 12, 2004, 1:06:13 AM (20 years ago)
- Location:
- orxonox/trunk/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/importer/object.cc
r2804 r2820 76 76 vertices = new Array(); 77 77 normals = new Array(); 78 vTexture = new Array(); 78 79 while(!OBJ_FILE->eof()) 79 80 { … … 114 115 else if (!strncmp(Buffer, "vt ", 2)) 115 116 { 116 // printf ("verticeTangent found");117 readVertexTexture(Buffer+3); 117 118 } 118 119 … … 149 150 normals->finalizeArray(); 150 151 glNormalPointer(GL_FLOAT, 0, normals->getArray()); 152 vTexture->finalizeArray(); 151 153 } 152 154 … … 208 210 //glArrayElement(atoi(vertex)-1); 209 211 glNormal3fv(normals->getArray() +(atoi(normal)-1)*3); 212 glTexCoord2fv(vTexture->getArray()+(atoi(texture)-1)*2); 210 213 glVertex3fv(vertices->getArray() +(atoi(vertex)-1)*3); 211 214 … … 225 228 } 226 229 230 bool 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 227 244 bool Object::readMtlLib (char* mtlFile) 228 245 { -
orxonox/trunk/importer/object.h
r2804 r2820 32 32 Array* colors; 33 33 Array* normals; 34 Array* vTexture; 34 35 char* objFileName; 35 36 char* mtlFileName; … … 45 46 bool readVT (char* vtString); 46 47 bool readVertexNormal (char* normalString); 48 bool readVertexTexture (char* vTextureString); 47 49 bool readMtlLib (char* matFile); 48 50 bool readUseMtl (char* mtlString);
Note: See TracChangeset
for help on using the changeset viewer.