Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 483


Ignore:
Timestamp:
Dec 12, 2007, 8:25:40 PM (16 years ago)
Author:
gabrieho
Message:

working but still poor skybox :)

Location:
code/branches/skybox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/skybox/bin/resources.cfg

    r399 r483  
    1010#FileSystem=../Media/materials/programs
    1111FileSystem=../Media/materials/scripts
    12 #FileSystem=../Media/materials/textures
     12FileSystem=../Media/materials/textures
     13FileSystem=../Media/packs/
    1314#FileSystem=../Media/models
    1415#FileSystem=../Media/overlays
     
    2122#Zip=../Media/packs/fresneldemo.zip
    2223#Zip=../Media/packs/ogretestmap.zip
    23 Zip=../Media/packs/skybox.zip
     24#Zip=../Media/packs/skybox.zip
     25Zip=../Media/packs/mysky.zip
  • code/branches/skybox/src/CMakeLists.txt

    r428 r483  
    33# create a few variables to simplify life
    44
    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)
     5SET(SRC_FILES orxonox.cc Universe.cpp loader/LevelLoader.cc xml/xmlParser.cc skybox/SkyBox.cc)
     6SET(INC_FILES Universe.h loader/LevelLoader.h xml/xmlParser.h skybox/SkyBox.h)
    77
    88#Creates an executable
  • code/branches/skybox/src/orxonox.cc

    r428 r483  
    3838#include <string>
    3939#include <iostream>
     40#include "Universe.h"
    4041
    4142#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
    4243#include <CoreFoundation/CoreFoundation.h>
    4344#include "windows.h"
    44 
    4545
    4646
     
    7373      Ogre::RenderWindow * mWindow;
    7474      Ogre::SceneManager *mgr;
    75       int stopper = 1;
    76 
     75      int stopper = 0;
    7776
    7877  class OrxApplication
     
    8887        createScene();
    8988        setupScene();
     89        createUniverse();
    9090        setupInputSystem();
    9191        setupCEGUI();
     
    172172      void setupScene()
    173173      {
    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                */
    183197
    184198       
     
    217231      {
    218232
    219         Ogre::Radian x1 = Ogre::Radian(x);
    220 
    221         unsigned int indice = 1;
     233        /*unsigned int indice = 1;
    222234        char filename[30];
    223235        char fn[1];
    224236        // generate new names...
    225         sprintf(filename, "SkyBox%d.png", stopper);
    226237        //sprintf(filename, "screenshot_%d.png", ++indice);
    227238        //sprintf(filename, fn, ++indice);
     239        */
    228240       
    229 
    230         Ogre::Radian x2 = Ogre::Radian((3.141592653589/2.0)*(stopper+1));
    231 
    232 
    233241        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");   
    238244        }
    239245        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");
    243249        }
    244250        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");
    248254        }
    249255        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        }
    255260        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");
    260264        }
    261265        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        }
    272269
    273270        stopper+=1;
     
    275272        stopper = 1;
    276273      }
     274
     275
     276
     277
     278        void createUniverse()
     279        {
     280
     281                // UNIVERSE-CLASS
     282std::cout << "1_1\n";
     283                Universe::Universe myUni = Universe(77000);
     284std::cout << "1_2\n";
     285                myUni.createCoordinates();
     286std::cout << "1_3\n";
     287                myUni.createBillboards(mgr, cam, mRoot);
     288std::cout << "1_4\n";
     289               
     290
     291        }
     292
     293
     294
    277295
    278296  class OrxExitListener : public Ogre::FrameListener
     
    344362#endif
    345363{
     364      srand(time(NULL));
    346365  try
    347366  {
Note: See TracChangeset for help on using the changeset viewer.