Changeset 3335 for GTP/trunk/App/Demos
- Timestamp:
- 03/09/09 18:45:10 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/ObjConverter.cpp
r3323 r3335 523 523 vector<Geometry *>::const_iterator it, it_end = mGeometry.end(); 524 524 525 Material defaultMaterial; 526 525 527 for (it = mGeometry.begin(); it != it_end; ++ it) 526 528 { 529 530 /////////////////////// 531 //-- write geometry 532 527 533 WriteGeometry(ofile, *it); 528 534 529 535 530 536 ///////// 531 //-- material 532 533 Material *mat = (*it)->mMaterial; 534 535 if (!mat) cerr << "error: no material specified!!" << endl; 537 //-- write material 538 539 Material *mat = (*it)->mMaterial ? (*it)->mMaterial : &defaultMaterial; 536 540 537 541 ofile.write(reinterpret_cast<char *>(&mat->texture), sizeof(int)); … … 540 544 //bool cullFaceEnabled = false; 541 545 bool cullFaceEnabled = true; 542 546 543 547 ofile.write(reinterpret_cast<char *>(&alphaTestEnabled), sizeof(bool)); 544 548 ofile.write(reinterpret_cast<char *>(&cullFaceEnabled), sizeof(bool)); … … 547 551 bool hasMaterial = true; 548 552 ofile.write(reinterpret_cast<char *>(&hasMaterial), sizeof(bool)); 549 553 550 554 SimpleVec ambient, diffuse, spec, emm; 551 555 552 556 ambient.x = ambient.y = ambient.z = 0.2f; 553 557 //diffuse.x = diffuse.y = diffuse.z = 1.0f; 554 diffuse.x = mat->rgb[0]; diffuse.y = mat->rgb[1]; diffuse.z = mat->rgb[2];558 diffuse.x = mat->rgb[0]; diffuse.y = mat->rgb[1]; diffuse.z = mat->rgb[2]; 555 559 spec.x = spec.y = spec.z = .0f; 556 560 emm = spec; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/ObjConverter2.cpp
r3275 r3335 486 486 Material *mat = (*it)->mMaterial; 487 487 488 if (!mat) cerr << "error: no material specified!!" << endl;488 if (!mat) cerr << "error: no material associated with this geometry!!" << endl; 489 489 490 490 ofile.write(reinterpret_cast<char *>(&mat->texture), sizeof(int)); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3325 r3335 657 657 Matrix4x4 transl = TranslationMatrix(positions[0]); 658 658 659 LoadModel("hbuddha.dem", dynamicObjects); 659 //LoadModel("hbuddha.dem", dynamicObjects); 660 LoadModel("torus.dem", dynamicObjects); 660 661 //LoadModel("venusm.dem", dynamicObjects); 661 662 … … 1174 1175 dynamicObjects[1]->GetTransform()->MultMatrix(rotMatrix); 1175 1176 1177 const float rotAngle2 = 0.6f * M_PI / 180.0f; 1178 1179 Matrix4x4 rotMatrix2 = RotationZMatrix(rotAngle); 1180 // hack: second buddha 1181 dynamicObjects[3]->GetTransform()->MultMatrix(rotMatrix2); 1182 1183 1176 1184 //const float moveSpeed = 5e-3f; 1177 1185 const float moveSpeed = 1e-1f;
Note: See TracChangeset
for help on using the changeset viewer.