Changeset 3071 in orxonox.OLD for orxonox/trunk/importer
- Timestamp:
- Dec 3, 2004, 9:14:21 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/importer/object.cc
r3070 r3071 323 323 printf("preparing to read in file: %s\n", fileName); 324 324 objFileName = fileName; 325 this->readFromObjFile ( objFileName);325 this->readFromObjFile (fileName); 326 326 return true; 327 327 } … … 432 432 bool Object::readVertex (char* vertexString) 433 433 { 434 char subbuffer1[20];435 char subbuffer2[20];436 char subbuffer3[20];437 sscanf (vertexString, "% s %s %s", subbuffer1, subbuffer2,subbuffer3);434 float subbuffer1; 435 float subbuffer2; 436 float subbuffer3; 437 sscanf (vertexString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3); 438 438 if (verbose >= 3) 439 printf ("reading in a vertex: % s %s %s\n", subbuffer1, subbuffer2,subbuffer3);440 vertices->addEntry( atof(subbuffer1)*scaleFactor, atof(subbuffer2)*scaleFactor, atof(subbuffer3)*scaleFactor);439 printf ("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3); 440 vertices->addEntry(subbuffer1*scaleFactor, subbuffer2*scaleFactor, subbuffer3*scaleFactor); 441 441 return true; 442 442 } … … 485 485 bool Object::readVertexNormal (char* normalString) 486 486 { 487 char subbuffer1[20];488 char subbuffer2[20];489 char subbuffer3[20];490 sscanf (normalString, "% s %s %s", subbuffer1, subbuffer2,subbuffer3);487 float subbuffer1; 488 float subbuffer2; 489 float subbuffer3; 490 sscanf (normalString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3); 491 491 if (verbose >=3 ) 492 printf("found vertex-Normal % s, %s, %s\n", subbuffer1,subbuffer2,subbuffer3);493 normals->addEntry( atof(subbuffer1), atof(subbuffer2), atof(subbuffer3));492 printf("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3); 493 normals->addEntry(subbuffer1, subbuffer2, subbuffer3); 494 494 return true; 495 495 } … … 502 502 bool Object::readVertexTexture (char* vTextureString) 503 503 { 504 char subbuffer1[20];505 char subbuffer2[20];506 sscanf (vTextureString, "% s %s", subbuffer1,subbuffer2);504 float subbuffer1; 505 float subbuffer2; 506 sscanf (vTextureString, "%f %f", &subbuffer1, &subbuffer2); 507 507 if (verbose >=3 ) 508 printf("found vertex-Texture % s, %s\n", subbuffer1,subbuffer2);509 vTexture->addEntry( atof(subbuffer1));510 vTexture->addEntry( atof(subbuffer2));508 printf("found vertex-Texture %f, %f\n", &subbuffer1, &subbuffer2); 509 vTexture->addEntry(subbuffer1); 510 vTexture->addEntry(subbuffer2); 511 511 return true; 512 512 }
Note: See TracChangeset
for help on using the changeset viewer.