Changeset 483
- Timestamp:
- Dec 12, 2007, 8:25:40 PM (17 years ago)
- Location:
- code/branches/skybox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/skybox/bin/resources.cfg
r399 r483 10 10 #FileSystem=../Media/materials/programs 11 11 FileSystem=../Media/materials/scripts 12 #FileSystem=../Media/materials/textures 12 FileSystem=../Media/materials/textures 13 FileSystem=../Media/packs/ 13 14 #FileSystem=../Media/models 14 15 #FileSystem=../Media/overlays … … 21 22 #Zip=../Media/packs/fresneldemo.zip 22 23 #Zip=../Media/packs/ogretestmap.zip 23 Zip=../Media/packs/skybox.zip 24 #Zip=../Media/packs/skybox.zip 25 Zip=../Media/packs/mysky.zip -
code/branches/skybox/src/CMakeLists.txt
r428 r483 3 3 # create a few variables to simplify life 4 4 5 SET(SRC_FILES orxonox.cc loader/LevelLoader.cc xml/xmlParser.cc skybox/SkyBox.cc)6 SET(INC_FILES loader/LevelLoader.h xml/xmlParser.h skybox/SkyBox.h)5 SET(SRC_FILES orxonox.cc Universe.cpp loader/LevelLoader.cc xml/xmlParser.cc skybox/SkyBox.cc) 6 SET(INC_FILES Universe.h loader/LevelLoader.h xml/xmlParser.h skybox/SkyBox.h) 7 7 8 8 #Creates an executable -
code/branches/skybox/src/orxonox.cc
r428 r483 38 38 #include <string> 39 39 #include <iostream> 40 #include "Universe.h" 40 41 41 42 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE 42 43 #include <CoreFoundation/CoreFoundation.h> 43 44 #include "windows.h" 44 45 45 46 46 … … 73 73 Ogre::RenderWindow * mWindow; 74 74 Ogre::SceneManager *mgr; 75 int stopper = 1; 76 75 int stopper = 0; 77 76 78 77 class OrxApplication … … 88 87 createScene(); 89 88 setupScene(); 89 createUniverse(); 90 90 setupInputSystem(); 91 91 setupCEGUI(); … … 172 172 void setupScene() 173 173 { 174 mgr = mRoot->createSceneManager(Ogre::ST_GENERIC, "Default SceneManager"); 175 cam = mgr->createCamera("Camera"); 176 cam->setPosition(Ogre::Vector3(0,0,0)); 177 //cam->lookAt(Ogre::Vector3(0,0,0)); 178 cam->setFOVy(Ogre::Degree(90)); 179 Ogre::Viewport *vp = mRoot->getAutoCreatedWindow()->addViewport(cam); 180 mgr->setSkyBox(true, "Examples/SpaceSkyBox"); 181 182 // camera pitch here works 174 mgr = mRoot->createSceneManager(Ogre::ST_GENERIC, "Default SceneManager"); 175 cam = mgr->createCamera("Camera"); 176 cam->setPosition(Ogre::Vector3(0,0,0)); 177 cam->lookAt(Ogre::Vector3(0,0,0)); 178 //cam->setFOVy(Ogre::Degree(90)); 179 Ogre::Viewport *vp = mRoot->getAutoCreatedWindow()->addViewport(cam); 180 181 Ogre::ColourValue fadeColour(0.0, 0.0, 0.0); 182 vp->setBackgroundColour(fadeColour); 183 mgr->setFog(Ogre::FOG_EXP, fadeColour, 0.0, 10000, 38000); 184 185 186 //mgr->setSkyBox(true, "Examples/SpaceSkybox"); 187 //mgr->setSkyBox(true, "MySky"); 188 189 mgr->setAmbientLight(Ogre::ColourValue(0.1, 1.0, 0.1)); 190 /*Ogre::Light *light = mgrtemp->createLight(lightnames); 191 light->setType(Ogre::Light::LT_POINT); 192 light->setPosition(Ogre::Vector3(0, 0, 0)); 193 194 light->setDiffuseColour(1.0, 0.0, 0.0); 195 light->setSpecularColour(1.0, 0.0, 0.0); 196 */ 183 197 184 198 … … 217 231 { 218 232 219 Ogre::Radian x1 = Ogre::Radian(x); 220 221 unsigned int indice = 1; 233 /*unsigned int indice = 1; 222 234 char filename[30]; 223 235 char fn[1]; 224 236 // generate new names... 225 sprintf(filename, "SkyBox%d.png", stopper);226 237 //sprintf(filename, "screenshot_%d.png", ++indice); 227 238 //sprintf(filename, fn, ++indice); 239 */ 228 240 229 230 Ogre::Radian x2 = Ogre::Radian((3.141592653589/2.0)*(stopper+1));231 232 233 241 if(stopper == 1){ 234 cam->yaw(Ogre::Degree(90)); 235 sprintf(filename, "SkyBox%d.png", stopper+1035); 236 mWindow->writeContentsToFile(filename); 237 242 //sprintf(filename, "stevecube_FR.bmp"); 243 mWindow->writeContentsToFile("MySky_FR.bmp"); 238 244 } 239 245 else if(stopper == 2){ 240 cam->yaw(Ogre::Degree(180));241 mWindow->writeContentsToFile(filename);242 246 //sprintf(filename, "stevecube_LF.bmp"); 247 cam->pitch(Ogre::Degree(90)); 248 mWindow->writeContentsToFile("MySky_LF.bmp"); 243 249 } 244 250 else if(stopper == 3){ 245 cam->yaw(Ogre::Degree(270));246 mWindow->writeContentsToFile(filename);247 251 //sprintf(filename, "stevecube_BK.bmp"); 252 cam->pitch(Ogre::Degree(90)); 253 mWindow->writeContentsToFile("MySky_BK.bmp"); 248 254 } 249 255 else if(stopper == 4){ 250 cam->yaw(Ogre::Degree(0)); 251 mWindow->writeContentsToFile(filename); 252 253 } 254 256 //sprintf(filename, "stevecube_RT.bmp"); 257 cam->pitch(Ogre::Degree(90)); 258 mWindow->writeContentsToFile("MySky_RT.bmp"); 259 } 255 260 else if(stopper == 5){ 256 257 cam->yaw(Ogre::Degree(0)); 258 mWindow->writeContentsToFile(filename); 259 261 //sprintf(filename, "stevecube_UP.bmp"); 262 cam->yaw(Ogre::Degree(90)); 263 mWindow->writeContentsToFile("MySky_UP.bmp"); 260 264 } 261 265 else if(stopper == 6){ 262 cam->yaw(Ogre::Degree(180)); 263 mWindow->writeContentsToFile(filename); 264 265 } 266 267 /*else if(stopper == 6){ 268 cam->roll(Ogre::Degree(270)); 269 }*/ 270 271 //cam->pitch(Ogre::Degree(90)*stopper); 266 cam->yaw(Ogre::Degree(-90)); 267 mWindow->writeContentsToFile("MySky_DN.bmp"); 268 } 272 269 273 270 stopper+=1; … … 275 272 stopper = 1; 276 273 } 274 275 276 277 278 void createUniverse() 279 { 280 281 // UNIVERSE-CLASS 282 std::cout << "1_1\n"; 283 Universe::Universe myUni = Universe(77000); 284 std::cout << "1_2\n"; 285 myUni.createCoordinates(); 286 std::cout << "1_3\n"; 287 myUni.createBillboards(mgr, cam, mRoot); 288 std::cout << "1_4\n"; 289 290 291 } 292 293 294 277 295 278 296 class OrxExitListener : public Ogre::FrameListener … … 344 362 #endif 345 363 { 364 srand(time(NULL)); 346 365 try 347 366 {
Note: See TracChangeset
for help on using the changeset viewer.