Changeset 6771 for code/branches/skybox2/src/modules/designtools
- Timestamp:
- Apr 22, 2010, 4:16:09 PM (15 years ago)
- Location:
- code/branches/skybox2/src/modules/designtools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/skybox2/src/modules/designtools/SkyboxGenerator.cc
r6673 r6771 32 32 #include <cassert> 33 33 #include <OgreRenderWindow.h> 34 #include <OgreCamera.h> 34 35 35 36 #include "core/ConsoleCommand.h" … … 42 43 #include "core/GraphicsManager.h" 43 44 #include "core/CommandExecutor.h" 45 #include "graphics/Camera.h" 44 46 45 47 … … 75 77 { 76 78 ControllableEntity* ce = HumanController::getLocalControllerSingleton()->getControllableEntity(); 79 Camera* camera = ce->getCamera(); 77 80 assert(ce); 78 81 79 82 Ogre::RenderWindow* w = GraphicsManager::getInstance().getRenderWindow(); 80 83 81 82 83 84 switch (iterateOverDirections_) 84 85 { 85 86 case 0 : 86 CommandExecutor::execute("pause"); 87 //w->writeContentsToFile(skyboxPrefix_+"FR.png"); 88 w->writeContentsToFile(skyboxPrefix_+"0.png"); 87 camera->getOgreCamera()->setFOVy(Degree(90)); 88 camera->getOgreCamera()->setAspectRatio(1); 89 iterateOverDirections_++; 90 break; 91 case 1 : 92 w->writeContentsToFile(skyboxPrefix_+"fr.png"); 93 //w->writeContentsToFile(skyboxPrefix_+"0.png"); 89 94 ce->yaw(Degree(90)); 90 95 iterateOverDirections_++; 91 96 break; 92 97 93 case 1 :94 //w->writeContentsToFile(skyboxPrefix_+"LF.png");95 w->writeContentsToFile(skyboxPrefix_+"1.png");96 ce->yaw(Degree(90));97 iterateOverDirections_++;98 break;99 100 98 case 2 : 101 //w->writeContentsToFile(skyboxPrefix_+"BK.png");102 w->writeContentsToFile(skyboxPrefix_+"2.png");99 w->writeContentsToFile(skyboxPrefix_+"lf.png"); 100 //w->writeContentsToFile(skyboxPrefix_+"1.png"); 103 101 ce->yaw(Degree(90)); 104 102 iterateOverDirections_++; … … 106 104 107 105 case 3 : 108 //w->writeContentsToFile(skyboxPrefix_+"RT.png"); 109 w->writeContentsToFile(skyboxPrefix_+"3.png"); 106 w->writeContentsToFile(skyboxPrefix_+"bk.png"); 107 //w->writeContentsToFile(skyboxPrefix_+"2.png"); 108 ce->yaw(Degree(90)); 109 iterateOverDirections_++; 110 break; 111 112 case 4 : 113 w->writeContentsToFile(skyboxPrefix_+"rt.png"); 114 //w->writeContentsToFile(skyboxPrefix_+"3.png"); 110 115 ce->yaw(Degree(90)); 111 116 ce->pitch(Degree(90)); … … 113 118 break; 114 119 115 case 4:116 //w->writeContentsToFile(skyboxPrefix_+"UP.png");117 w->writeContentsToFile(skyboxPrefix_+"4.png");120 case 5 : 121 w->writeContentsToFile(skyboxPrefix_+"up.png"); 122 //w->writeContentsToFile(skyboxPrefix_+"4.png"); 118 123 ce->pitch(Degree(180)); 119 124 iterateOverDirections_++; 120 125 break; 121 126 122 case 5:123 //w->writeContentsToFile(skyboxPrefix_+"DN.png");124 w->writeContentsToFile(skyboxPrefix_+"5.png");127 case 6 : 128 w->writeContentsToFile(skyboxPrefix_+"dn.png"); 129 //w->writeContentsToFile(skyboxPrefix_+"5.png"); 125 130 ce->pitch(Degree(90)); 131 iterateOverDirections_++; 132 break; 133 134 case 7 : 135 camera->getOgreCamera()->setAspectRatio(1.3333); 136 camera->getOgreCamera()->setFOVy(Degree(45)); 126 137 iterateOverDirections_ =0; 127 138 takeScreenshot_ = false; 128 139 CommandExecutor::execute("pause"); 129 130 140 } 131 141 } … … 134 144 void SkyboxGenerator::createSkybox( ) 135 145 { 136 137 146 SkyboxGenerator::getInstance().takeScreenshot_ = true; 138 139 140 147 CommandExecutor::execute("pause"); 141 148 } 142 149 } -
code/branches/skybox2/src/modules/designtools/SkyboxGenerator.h
r6673 r6771 50 50 std::string skyboxPrefix_; 51 51 bool takeScreenshot_; 52 int iterateOverDirections_; 53 52 int iterateOverDirections_; 54 53 }; 55 54 }
Note: See TracChangeset
for help on using the changeset viewer.