Changeset 1629 for GTP/trunk/App/Demos/Illum/Ogre/src/DiffuseTest
- Timestamp:
- 10/17/06 09:25:48 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/src/DiffuseTest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/DiffuseTest/include/DiffuseTest.h
r1611 r1629 29 29 float causize = 10; 30 30 float cauintens = 40; 31 int scene = 1;31 int scene = 3; 32 32 // Listener class for frame updates 33 33 class RaytraceDemoListener : public ExampleFrameListener … … 55 55 if (mInputDevice->isKeyDown(KC_MULTIPLY)) 56 56 { 57 objectNode->scale(1.1,1.1,1.1); 57 //objectNode->scale(1.1,1.1,1.1); 58 objectNode->rotate(Vector3(0,0,1), Degree(10)); 58 59 mTimeUntilNextToggle = 1; 59 60 } 60 61 if (mInputDevice->isKeyDown(KC_DIVIDE)) 61 62 { 62 objectNode->scale(1.0/1.1,1.0/1.1,1.0/1.1); 63 //objectNode->scale(1.0/1.1,1.0/1.1,1.0/1.1); 64 objectNode->rotate(Vector3(1,0,0), Degree(10)); 63 65 mTimeUntilNextToggle = 1; 64 66 } … … 66 68 { 67 69 objectNode->rotate(Vector3(0,1,0), Degree(10)); 70 } 71 if (mInputDevice->isKeyDown(KC_HOME)) 72 { 73 objectNode->translate(0,0.5,0); 74 } 75 if (mInputDevice->isKeyDown(KC_END)) 76 { 77 objectNode->translate(0,-0.5,0); 68 78 } 69 79 if (mInputDevice->isKeyDown(KC_DOWN)) … … 329 339 Root::getSingleton()._setCurrentSceneManager(mSceneMgr); 330 340 331 mCamera->setPosition(0,1 0,10);341 mCamera->setPosition(0,1,0); 332 342 mCamera->setFOVy(Radian(Degree(80))); 333 343 mCamera->setFarClipDistance(200); 334 344 mCamera->setNearClipDistance(0.1); 335 345 336 if(scene == 1) 337 createScene1(); 338 else 339 createScene2(); 340 346 switch (scene) 347 { 348 case 1: 349 createScene1();break; 350 case 2: 351 createScene2();break; 352 case 3: 353 createScene3();break; 354 } 341 355 OgreIlluminationManager::getSingleton().initTechniques(); 342 356 … … 502 516 503 517 // mSceneMgr->setAmbientLight(ColourValue(0.1, 0.0537, 0.0)); 504 mSceneMgr->setAmbientLight(ColourValue(0. 0, 0.0, 0.0));518 mSceneMgr->setAmbientLight(ColourValue(0.2, 0.25, 0.3)); 505 519 506 520 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 507 521 508 Entity* object = mSceneMgr->createEntity("object", " athene.mesh");522 Entity* object = mSceneMgr->createEntity("object", "santa.mesh"); 509 523 object->setMaterialName("GameTools/Diffuse/use"); 510 524 //object->setMaterialName("GameTools/Diffuse2"); 511 525 objectNode = rootNode->createChildSceneNode(); 512 526 objectNode->attachObject(object); 513 objectNode->scale(0.05,0.05,0.05); 514 objectNode->setPosition(0,4,0); 527 objectNode->scale(0.5,0.5,0.5); 528 objectNode->rotate(Vector3(0,1,0),Radian(Math::PI)); 529 objectNode->setPosition(0,0,2); 515 530 objectNode->_updateBounds(); 516 531 … … 559 574 560 575 576 } 577 578 void createScene3() 579 { 580 mSceneMgr->setAmbientLight(ColourValue(0.505 * 0.2, 0.897 * 0.2, 0.914 * 0.2)); 581 582 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 583 584 Entity* object = mSceneMgr->createEntity("object", "santa.mesh"); 585 object->setMaterialName("GameTools/Diffuse/use"); 586 //object->setMaterialName("GameTools/Diffuse2"); 587 objectNode = rootNode->createChildSceneNode(); 588 objectNode->attachObject(object); 589 objectNode->scale(0.1,0.1,0.1); 590 objectNode->rotate(Vector3(0,1,0),Radian(Math::PI)); 591 objectNode->setPosition(0,0,2); 592 objectNode->_updateBounds(); 593 594 Entity* room = mSceneMgr->createEntity("scene", "difflab.mesh"); 595 //room->setMaterialName("GameTools/Phong"); 596 SceneNode* roomNode = rootNode->createChildSceneNode(); 597 roomNode->attachObject(room); 598 roomNode->_updateBounds(); 599 600 mSceneMgr->setShadowTechnique(SHADOWTYPE_NONE); 601 Light* redLight1 = mSceneMgr->createLight("RedLight1"); 602 redLight1->setType(Light::LT_POINT); 603 redLight1->setCastShadows(false); 604 redLight1->setDiffuseColour(ColourValue(1,0.055, 0.0)); 605 redLight1->setPowerScale(1.6); 606 SceneNode* redLightNode1 = rootNode->createChildSceneNode(); 607 redLightNode1->setPosition(0.05,2.361,-1.07); 608 redLightNode1->attachObject(redLight1); 609 610 Light* greenLight1 = mSceneMgr->createLight("GreenLight1"); 611 greenLight1->setType(Light::LT_POINT); 612 greenLight1->setCastShadows(false); 613 greenLight1->setDiffuseColour(ColourValue(0.362,0.783, 0.685)); 614 greenLight1->setPowerScale(2.0); 615 SceneNode* greenLightNode1 = rootNode->createChildSceneNode(); 616 greenLightNode1->setPosition(1.312,1.313,0); 617 greenLightNode1->attachObject(greenLight1); 618 619 Light* mainBlueLight = mSceneMgr->createLight("MainBlueLight"); 620 mainBlueLight->setType(Light::LT_SPOTLIGHT); 621 mainBlueLight->setCastShadows(true); 622 mainBlueLight->setDiffuseColour(ColourValue(0.395,0.766, 1.0)); 623 mainBlueLight->setPowerScale(5.0); 624 mainBlueLight->setSpotlightRange(Degree(20),Degree(90)); 625 SceneNode* mainBlueLightNode = rootNode->createChildSceneNode(); 626 mainBlueLightNode->setPosition(-0.546,2.095,1.035); 627 //mainBlueLightNode->rotate(Vector3::UNIT_X, Degree(161.396)); 628 //mainBlueLightNode->rotate(Vector3::UNIT_Y, Degree(53.955)); 629 //mainBlueLightNode->rotate(Vector3::UNIT_Z, Degree(-145.065)); 630 mainBlueLight->setDirection(-1.5,-2.0,1.0); 631 mainBlueLightNode->attachObject(mainBlueLight); 632 /* 633 Light* blueLight1 = mSceneMgr->createLight("BlueLight1"); 634 blueLight1->setType(Light::LT_SPOTLIGHT); 635 blueLight1->setCastShadows(false); 636 blueLight1->setDiffuseColour(ColourValue(0.395,0.766, 1.0)); 637 blueLight1->setPowerScale(0.7); 638 blueLight1->setSpotlightRange(Degree(20),Degree(90)); 639 SceneNode* blueLightNode = rootNode->createChildSceneNode(); 640 blueLightNode->setPosition(-0.9,2.095,0.185); 641 //blueLightNode->rotate(Vector3::UNIT_X, Degree(148.785)); 642 //blueLightNode->rotate(Vector3::UNIT_Y, Degree(39.001)); 643 //blueLightNode->rotate(Vector3::UNIT_Z, Degree(-154.304)); 644 blueLight1->setDirection(-1.5,-2.0,1.0); 645 blueLightNode->attachObject(blueLight1); 646 647 Light* blueLight2 = mSceneMgr->createLight("BlueLight2"); 648 blueLight2->setType(Light::LT_SPOTLIGHT); 649 blueLight2->setCastShadows(false); 650 blueLight2->setDiffuseColour(ColourValue(0.395,0.766, 1.0)); 651 blueLight2->setPowerScale(0.7); 652 blueLight2->setSpotlightRange(Degree(20),Degree(90)); 653 SceneNode* blueLightNode2 = rootNode->createChildSceneNode(); 654 blueLightNode2->setPosition(0.091,2.095,1.556); 655 //blueLightNode2->rotate(Vector3::UNIT_X, Degree(-112.941)); 656 //blueLightNode2->rotate(Vector3::UNIT_Y, Degree(68.432)); 657 //blueLightNode2->rotate(Vector3::UNIT_Z, Degree(-66.441)); 658 blueLight2->setDirection(-1.5,-2.0,1.0); 659 blueLightNode2->attachObject(blueLight2); */ 561 660 } 562 661 -
GTP/trunk/App/Demos/Illum/Ogre/src/DiffuseTest/scripts/DiffuseTest.vcproj
r1598 r1629 155 155 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> 156 156 <File 157 RelativePath="..\..\..\Media\materials\scripts\difflab.material"> 158 </File> 159 <File 157 160 RelativePath="..\..\..\Media\materials\scripts\diffscene.material"> 158 161 </File>
Note: See TracChangeset
for help on using the changeset viewer.