Changeset 5308 in orxonox.OLD for trunk/src/lib/graphics/importer/model.cc
- Timestamp:
- Oct 8, 2005, 12:32:52 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/model.cc
r5304 r5308 65 65 66 66 this->next = NULL; 67 68 67 } 69 68 … … 383 382 ////////// 384 383 /** 385 * 384 * adds a new Material to the Material List 386 385 * @param material the Material to add 387 386 * @returns the added material … … 392 391 Material* Model::addMaterial(Material* material) 393 392 { 393 if (material == NULL) 394 return NULL; 394 395 ModelMaterial* modMat = new ModelMaterial; 395 396 modMat->external = true; … … 408 409 ModelMaterial* modMat = new ModelMaterial; 409 410 modMat->external = false; 410 modMat->material = new Material(); 411 modMat->material->setName(materialName); 411 modMat->material = new Material(materialName); 412 412 413 413 // adding material to the List of materials … … 474 474 float subbuffer3; 475 475 sscanf (vertexString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3); 476 PRINTF(5)("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3);477 476 this->vertices->addEntry(subbuffer1*scaleFactor, subbuffer2*scaleFactor, subbuffer3*scaleFactor); 478 477 this->vertexCount++; … … 507 506 float subbuffer3; 508 507 sscanf (normalString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3); 509 PRINTF(5)("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3);510 508 this->normals->addEntry(subbuffer1, subbuffer2, subbuffer3); 511 509 this->normalCount++; … … 543 541 float subbuffer2; 544 542 sscanf (vTextureString, "%f %f", &subbuffer1, &subbuffer2); 545 PRINTF(5)("found vertex-Texture %f, %f\n", &subbuffer1, &subbuffer2);546 543 this->vTexture->addEntry(subbuffer1); 547 544 this->vTexture->addEntry(1 - subbuffer2); … … 659 656 660 657 /** 661 * 658 * Function that selects a material, if changed in the obj file. 662 659 * @param matString the Material that will be set. 663 660 */ … … 674 671 675 672 /** 676 * 673 * Function that selects a material, if changed in the obj file. 677 674 * @param mtl the Material that will be set. 678 675 */ … … 1106 1103 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,1,16, 7,10,17, 5,11,18, 3,3,19); 1107 1104 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,12,20, 0,0,21, 2,2,22, 4,13,23); 1108 1109 } 1105 }
Note: See TracChangeset
for help on using the changeset viewer.