- Timestamp:
- Nov 21, 2004, 3:21:20 AM (20 years ago)
- Location:
- orxonox/trunk/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/importer/object.cc
r2932 r2934 377 377 { 378 378 currentGroup->vertices->finalizeArray(); 379 glVertexPointer(3, GL_FLOAT, 0, currentGroup->vertices->getArray());379 // glVertexPointer(3, GL_FLOAT, 0, currentGroup->vertices->getArray()); 380 380 currentGroup->normals->finalizeArray(); 381 glNormalPointer(GL_FLOAT, 0, currentGroup->normals->getArray());381 // glNormalPointer(GL_FLOAT, 0, currentGroup->normals->getArray()); 382 382 currentGroup->vTexture->finalizeArray(); 383 383 } … … 385 385 readingVertices = false; 386 386 currentGroup->faceCount++; 387 char subbuffer1[20]; 388 char subbuffer2[20]; 389 char subbuffer3[20]; 390 char subbuffer4[20] =""; 391 sscanf (faceString, "%s %s %s %s", subbuffer1, subbuffer2, subbuffer3, subbuffer4); 392 if (!strcmp(subbuffer4, "")) 387 388 int elemCount = 0; 389 390 FaceElement* firstElem = new FaceElement; 391 FaceElement* tmpElem = firstElem; 392 393 394 while(strcmp (faceString, "\0")) 395 { 396 if (elemCount>0) 397 tmpElem = tmpElem->next = new FaceElement; 398 tmpElem->next = NULL; 399 400 401 sscanf (faceString, "%s", tmpElem->value); 402 faceString += strlen(tmpElem->value); 403 if (strcmp (faceString, "\0")) 404 faceString++; 405 elemCount++; 406 407 408 } 409 410 411 if (elemCount == 3) 393 412 { 394 413 if (currentGroup->faceMode != 3) … … 401 420 currentGroup->faceMode = 3; 402 421 if (verbose >=3) 403 printf ("found triag: %s, %s, %s\n", subbuffer1, subbuffer2, subbuffer3); 404 addGLElement(subbuffer1); 405 addGLElement(subbuffer2); 406 addGLElement(subbuffer3); 407 return true; 408 } 409 else 422 printf ("found triag.\n"); 423 } 424 425 else if (elemCount == 4) 410 426 { 411 427 if (currentGroup->faceMode != 4) … … 417 433 currentGroup->faceMode = 4; 418 434 if (verbose >=3 ) 419 printf ("found quad: %s, %s, %s, %s\n", subbuffer1, subbuffer2, subbuffer3, subbuffer4); 420 addGLElement(subbuffer1); 421 addGLElement(subbuffer2); 422 addGLElement(subbuffer3); 423 addGLElement(subbuffer4); 424 return true; 425 } 435 printf ("found quad.\n"); 436 } 437 438 else if (elemCount > 4) 439 { 440 if (currentGroup->faceMode != -1) 441 glEnd(); 442 glBegin(GL_POLYGON); 443 if (verbose >=3) 444 printf ("Polygon with %i faces found.", elemCount); 445 currentGroup->faceMode = elemCount; 446 } 447 448 tmpElem = firstElem; 449 while (tmpElem != NULL) 450 { 451 // printf ("%s\n", tmpElem->value); 452 addGLElement(tmpElem->value); 453 tmpElem = tmpElem->next; 454 } 455 426 456 } 427 457 -
orxonox/trunk/importer/object.h
r2863 r2934 18 18 extern int verbose; //!< fill be removed and added again as a verbose-class 19 19 20 21 struct FaceElement 22 { 23 char value[20]; 24 FaceElement* next; 25 }; 20 26 21 27 //! Class that handles 3D-Objects. it can also read them in and display them.
Note: See TracChangeset
for help on using the changeset viewer.