Changeset 3342 for GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter
- Timestamp:
- 04/13/09 08:44:22 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/ObjConverter.cpp
r3335 r3342 523 523 vector<Geometry *>::const_iterator it, it_end = mGeometry.end(); 524 524 525 Material defaultMaterial;526 527 525 for (it = mGeometry.begin(); it != it_end; ++ it) 528 526 { 529 530 ///////////////////////531 //-- write geometry532 533 527 WriteGeometry(ofile, *it); 534 528 535 529 536 530 ///////// 537 //-- write material 538 539 Material *mat = (*it)->mMaterial ? (*it)->mMaterial : &defaultMaterial; 531 //-- material 532 533 Material *mat = (*it)->mMaterial; 534 535 if (!mat) cerr << "error: no material specified!!" << endl; 540 536 541 537 ofile.write(reinterpret_cast<char *>(&mat->texture), sizeof(int)); … … 544 540 //bool cullFaceEnabled = false; 545 541 bool cullFaceEnabled = true; 546 542 547 543 ofile.write(reinterpret_cast<char *>(&alphaTestEnabled), sizeof(bool)); 548 544 ofile.write(reinterpret_cast<char *>(&cullFaceEnabled), sizeof(bool)); … … 551 547 bool hasMaterial = true; 552 548 ofile.write(reinterpret_cast<char *>(&hasMaterial), sizeof(bool)); 553 549 554 550 SimpleVec ambient, diffuse, spec, emm; 555 551 556 552 ambient.x = ambient.y = ambient.z = 0.2f; 557 553 //diffuse.x = diffuse.y = diffuse.z = 1.0f; 558 diffuse.x = mat->rgb[0]; diffuse.y = 554 diffuse.x = mat->rgb[0]; diffuse.y =mat->rgb[1]; diffuse.z = mat->rgb[2]; 559 555 spec.x = spec.y = spec.z = .0f; 560 556 emm = spec; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/ObjConverter2.cpp
r3335 r3342 486 486 Material *mat = (*it)->mMaterial; 487 487 488 if (!mat) cerr << "error: no material associated with this geometry!!" << endl;488 if (!mat) cerr << "error: no material specified!!" << endl; 489 489 490 490 ofile.write(reinterpret_cast<char *>(&mat->texture), sizeof(int)); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/main.cpp
r3334 r3342 14 14 15 15 cout << "converting obj to dem format" << endl; 16 #if 1 // use this path for converting a file with materials17 if (argc > 3)16 #if 1 17 if (!converter.LoadMaterials(model_path + argv[3])) 18 18 { 19 if (!converter.LoadMaterials(model_path + argv[3])) 20 { 21 cerr << "loading materials failed" << endl; 19 cerr << "loading materials failed" << endl; 22 20 23 std::cin.get(); 24 exit(0); 25 } 21 std::cin.get(); 22 exit(0); 26 23 } 27 24 … … 33 30 exit(0); 34 31 } 35 #else // use this bath to convert the pompeii model32 #else 36 33 37 34 //const int numFiles = 879;
Note: See TracChangeset
for help on using the changeset viewer.