Changeset 3362 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
- Timestamp:
- 04/24/09 18:00:06 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3361 r3362 628 628 629 629 if (0) LoadPompeiiFloor(); 630 630 631 #if 1 631 632 … … 642 643 // sibenik positions 643 644 VertexArray positions; 644 645 const float factor2 = 1.6f; 645 646 // for buddha (lowres) 646 positions.push_back(Vector3(6.07307, 8.20723, 6.62 ));647 positions.push_back(Vector3(-17.1935, 11.1687, 8.8781 ));648 positions.push_back(Vector3(1.50032, 31.1943, 19.1f));647 positions.push_back(Vector3(6.07307, 8.20723, 6.62 - factor2)); 648 positions.push_back(Vector3(-17.1935, 11.1687, 8.8781 - factor2)); 649 //positions.push_back(Vector3(1.50032, 31.1943, 19.1f)); 649 650 650 651 // for happy buddha … … 655 656 // for dragon 656 657 //positions.push_back(Vector3(6.07307, 8.20723, 5.0f)); 657 //positions.push_back(Vector3(0, 0, -0.8 ));658 //positions.push_back(Vector3(0, 0, -0.8f)); 658 659 659 660 #endif … … 661 662 //const Vector3 sceneCenter(470.398f, 240.364f, 180.3); 662 663 Matrix4x4 transl = TranslationMatrix(positions[0]); 663 664 //LoadModel("dragon.dem", dynamicObjects); 665 666 #if 1 667 664 668 //LoadModel("hbuddha.dem", dynamicObjects); 665 669 //LoadModel("horse.dem", dynamicObjects); 666 LoadModel("happy.dem", dynamicObjects); 667 //LoadModel("dragon.dem", dynamicObjects); 670 LoadModel("happy2.dem", dynamicObjects); 668 671 //LoadModel("torus.dem", dynamicObjects); 669 672 //LoadModel("venusm.dem", dynamicObjects); … … 678 681 } 679 682 680 /* 683 681 684 const float rotAngle = M_PI / 2.0f; 682 685 const Matrix4x4 rotMatrix = RotationXMatrix(rotAngle); … … 685 688 // hack: second buddha 686 689 dynamicObjects[0]->GetTransform()->MultMatrix(rotMatrix); 687 dynamicObjects[0]->GetTransform()->MultMatrix(scaleMatrix);688 689 dynamicObjects[1]->GetTransform()->MultMatrix(rotMatrix);690 //dynamicObjects[0]->GetTransform()->MultMatrix(scaleMatrix); 691 692 /*dynamicObjects[1]->GetTransform()->MultMatrix(rotMatrix); 690 693 dynamicObjects[1]->GetTransform()->MultMatrix(scaleMatrix); 691 694 … … 698 701 699 702 #endif 700 703 #endif 701 704 // hack 702 705 resourceManager->mUseNormalMapping = false; … … 732 735 733 736 // set far plane based on scene extent 734 //farDist = 10.0f * Magnitude(bvh->GetBox().Diagonal());735 farDist = 1000.0f;737 farDist = 10.0f * Magnitude(bvh->GetBox().Diagonal()); 738 //farDist = 1000.0f; 736 739 camera->SetFar(farDist); 737 740 … … 1180 1183 buddha->GetTransform()->SetMatrix(trafo); 1181 1184 1185 const float rotAngle3 = M_PI / 2.0f; 1186 const Matrix4x4 rotMatrix3 = RotationZMatrix(rotAngle3); 1187 1188 // hack: second buddha 1189 buddha->GetTransform()->MultMatrix(rotMatrix3); 1190 1182 1191 #if TODO // drop objects on ground floor 1183 1192 for (int i = 0; i < 10; ++ i) … … 1194 1203 #endif 1195 1204 1196 #if 11197 1205 ///////////////////////// 1198 1206 //-- update animations 1199 1207 1208 1200 1209 //const float rotAngle = M_PI * 1e-3f; 1201 const float rotAngle = 0.3f * M_PI / 180.0f;1202 //const float rotAngle = 0.6f * M_PI / 180.0f;1210 //const float rotAngle = 0.3f * M_PI / 180.0f; 1211 const float rotAngle = 0.6f * M_PI / 180.0f; 1203 1212 1204 1213 Matrix4x4 rotMatrix = RotationZMatrix(rotAngle); … … 1214 1223 const float moveSpeed = 1e-1f; 1215 1224 motionPath->Move(moveSpeed); 1216 #endif1217 1225 } 1218 1226 … … 1488 1496 } 1489 1497 1490 if (makeSnapShot) makeSnapShot = false; 1498 static int dummy = 0; 1499 if (makeSnapShot && (dummy ++ == 650)) makeSnapShot = false; 1491 1500 1492 1501 ShadowMap *sm = showShadowMap ? shadowMap : NULL; … … 2017 2026 void RightMotionLight(int x, int y) 2018 2027 { 2019 float theta = 0.2f * M_PI * (xEyeBegin - x) / 180.0f;2020 float phi = 0.2f * M_PI * (yMotionBegin - y) / 180.0f;2028 const float theta = .2f * M_PI * (xEyeBegin - x) / 180.0f; 2029 const float phi = .2f * M_PI * (yMotionBegin - y) / 180.0f; 2021 2030 2022 2031 Vector3 lightDir = light->GetDirection(); … … 2069 2078 Vector3 rVec(viewDir[0], viewDir[1], 0); 2070 2079 2071 Matrix4x4 rot = RotationZMatrix(M_PI * 0.5f);2080 Matrix4x4 rot = RotationZMatrix(M_PI * .5f); 2072 2081 rVec = rot * rVec; 2073 2082 2074 pos -= rVec * (x - horizontalMotionBegin) * mouseMotion;2083 pos -= rVec * (x - horizontalMotionBegin) * mouseMotion; 2075 2084 pos[2] += (verticalMotionBegin - y) * mouseMotion; 2076 2085
Note: See TracChangeset
for help on using the changeset viewer.