Changeset 1879 for GTP/trunk/App/Demos/Illum/Ogre/src
- Timestamp:
- 12/11/06 16:30:08 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/Common/include/FrameCapture.h
r1847 r1879 79 79 isRecording = false; 80 80 isSaving = false; 81 framerate = 20;81 framerate = 15; 82 82 frameTime = 1000 / framerate; 83 83 lastTime = 0; -
GTP/trunk/App/Demos/Illum/Ogre/src/DiffuseTest/include/DiffuseTest.h
r1868 r1879 368 368 } 369 369 370 void createCamera(void) 371 { 372 // Create the camera 373 mCamera = mSceneMgr->createCamera("PlayerCam"); 374 375 SceneNode* camNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("mainCameraNode"); 376 camNode->attachObject(mCamera); 377 //camNode->setPosition(Vector3(0,1,0)); 378 // Position it at 500 in Z direction 379 //mCamera->setPosition(Vector3(0,0,500)); 380 // Look back along -Z 381 //mCamera->lookAt(Vector3(0,0,-300)); 382 mCamera->setNearClipDistance(5); 383 384 } 370 385 371 386 void createScene(void) 372 387 { 373 388 374 createPostproc();389 //createPostproc(); 375 390 376 391 OgreIlluminationManager::getSingleton().setMainCamera(mCamera); … … 381 396 Root::getSingleton()._setCurrentSceneManager(mSceneMgr); 382 397 383 mCamera->setPosition(0,1,0);398 //mCamera->setPosition(0,1,0); 384 399 mCamera->setFOVy(Radian(Degree(80))); 385 400 mCamera->setFarClipDistance(200); … … 643 658 SceneNode* roomNode = rootNode->createChildSceneNode(); 644 659 roomNode->attachObject(room); 645 roomNode->_updateBounds(); 660 roomNode->_updateBounds(); 661 662 663 capture->addAnimableNode(objectNode); 664 capture->addAnimableNode(mCamera->getParentSceneNode()); 646 665 647 666 mSceneMgr->setShadowTechnique(SHADOWTYPE_NONE); -
GTP/trunk/App/Demos/Illum/Ogre/src/HierarchicalSystem/include/HierarchicalSystem.h
r1834 r1879 27 27 28 28 29 int scene = 2; 30 29 31 // Listener class for frame updates 30 32 class ParticleDemoFrameListener : public ExampleFrameListener … … 32 34 protected: 33 35 34 unsigned long framecount;35 36 SceneNode* lightNode; 36 37 … … 40 41 41 42 { 42 this->lightNode = lightNode; 43 framecount = 0; 43 this->lightNode = lightNode; 44 44 } 45 45 … … 48 48 bool result = ExampleFrameListener::frameStarted(evt); 49 49 50 Timer* timer = Root::getSingleton().getTimer(); 51 52 float t = (float) timer->getMilliseconds() / 2000.0; 53 float r = 150; 54 lightNode->setPosition( r * sin(t), r * sin(5 * t) + 200 , r * cos(t)); 55 56 framecount++; 50 if(scene == 1) 51 { 52 Timer* timer = Root::getSingleton().getTimer(); 53 54 float t = (float) timer->getMilliseconds() / 2000.0; 55 float r = 150; 56 lightNode->setPosition( r * sin(t), r * sin(5 * t) + 200 , r * cos(t)); 57 } 57 58 return result; 58 59 } … … 82 83 virtual void chooseSceneManager(void) 83 84 { 84 ExampleApplication::chooseSceneManager(); 85 // Get the SceneManager, in this case a generic one 86 // mSceneMgr = mRoot->createSceneManager("TerrainSceneManager"); 85 if(scene == 1) 86 ExampleApplication::chooseSceneManager(); 87 else if(scene == 2) 88 mSceneMgr = mRoot->createSceneManager("TerrainSceneManager"); 87 89 } 88 90 … … 94 96 OgreIlluminationManager::getSingleton().setMainViewport(mWindow->getViewport(0)); 95 97 96 //std::string terrain_cfg("terrain.cfg"); 97 //mSceneMgr -> setWorldGeometry( terrain_cfg ); 98 98 99 99 Root::getSingleton()._setCurrentSceneManager(mSceneMgr); 100 mCamera->setPosition(0,150,100); 101 mCamera->setDirection(0,0,-1); 100 102 101 mCamera->setFOVy(Radian(Degree(80))); 103 mCamera->setFarClipDistance( 1000);102 mCamera->setFarClipDistance(5000); 104 103 // Set ambient light 105 104 mSceneMgr->setAmbientLight(ColourValue(1, 1, 1)); … … 107 106 // Skybox 108 107 mSceneMgr->setSkyBox(true, "Examples/EveningSkyBox", 10); 109 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 110 111 /* 112 //init objects 113 Entity* kupola = mSceneMgr->createEntity("kupola", "kupola.mesh"); 114 115 //init nodes 116 kupolaNode = rootNode->createChildSceneNode( "kupola" ); 117 kupolaNode->rotate(Vector3(0,1,0),Radian(Degree(90))); 118 //kupolaNode->setPosition(0, -150, 0); 119 kupolaNode->attachObject( kupola ); 120 kupolaNode->scale(50,50,50); 121 kupolaNode->_updateBounds(); 122 MeshPtr kmesh = kupola->getMesh(); 123 kmesh->buildTangentVectors(0,1);*/ 108 109 124 110 125 Entity* head = mSceneMgr->createEntity("head", "athene.mesh"); 126 SceneNode* headNode = rootNode->createChildSceneNode("head"); 127 head->setMaterialName("GameTools/Standard"); 128 headNode->attachObject(head); 129 //headNode->setScale(1.5,1.5,1.5); 130 AxisAlignedBox bbox = head->getBoundingBox(); 131 headNode->setPosition(0,80,20); 132 headNode->_updateBounds(); 111 133 112 134 ParticleSystem* pSys1 = mSceneMgr->createParticleSystem("psys1", "GameTools/Big"); 135 pSys1->setKeepParticlesInLocalSpace(false); 136 SceneNode *pSysNode = rootNode->createChildSceneNode("psys1"); 137 pSysNode->attachObject(pSys1); 138 pSysNode->setPosition(0,0,0); 113 // OgreIlluminationManager::getSingleton().createGlobalRun(ILLUMRUN_PHASE_TEXTURE); 114 // OgreIlluminationManager::getSingleton().updateGlobalRun(ILLUMRUN_PHASE_TEXTURE, 1); 115 // OgreIlluminationManager::getSingleton().savePhaseTextureToFile("phase.dds"); 116 117 118 if(scene == 1) 119 createScene1(); 120 else if(scene == 2) 121 createScene2(); 122 123 124 OgreIlluminationManager::getSingleton().initTechniques(); 125 126 } 127 128 void createScene1() 129 { 130 mCamera->setPosition(0,150,100); 131 mCamera->setDirection(0,0,-1); 132 133 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 134 135 Entity* head = mSceneMgr->createEntity("head", "athene.mesh"); 136 SceneNode* headNode = rootNode->createChildSceneNode("head"); 137 head->setMaterialName("GameTools/Standard"); 138 headNode->attachObject(head); 139 //headNode->setScale(1.5,1.5,1.5); 140 AxisAlignedBox bbox = head->getBoundingBox(); 141 headNode->setPosition(0,80,20); 142 headNode->_updateBounds(); 143 144 145 ParticleSystem* pSys1 = mSceneMgr->createParticleSystem("psys1", "GameTools/Big"); 146 pSys1->setKeepParticlesInLocalSpace(false); 147 SceneNode *pSysNode = rootNode->createChildSceneNode("psys1"); 148 pSysNode->attachObject(pSys1); 149 pSysNode->setPosition(0,0,0); 139 150 140 151 //Init lights … … 151 162 bbs->setMaterialName("Flare"); 152 163 mainLightNode->attachObject(bbs); 164 } 153 165 154 // OgreIlluminationManager::getSingleton().createGlobalRun(ILLUMRUN_PHASE_TEXTURE); 155 // OgreIlluminationManager::getSingleton().updateGlobalRun(ILLUMRUN_PHASE_TEXTURE, 1); 156 // OgreIlluminationManager::getSingleton().savePhaseTextureToFile("phase.dds"); 166 void createScene2() 167 { 168 mCamera->setPosition(0,150,100); 169 mCamera->setDirection(0,0,-1); 157 170 158 OgreIlluminationManager::getSingleton().initTechniques(); 171 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 172 std::string terrain_cfg("terrain.cfg"); 173 mSceneMgr -> setWorldGeometry( terrain_cfg ); 174 175 ParticleSystem* pSys1 = mSceneMgr->createParticleSystem("psys1", "GameTools/FogBig"); 176 pSys1->setKeepParticlesInLocalSpace(false); 177 SceneNode *pSysNode = rootNode->createChildSceneNode("psys1"); 178 pSysNode->attachObject(pSys1); 179 pSysNode->setPosition(600,-50,600); 159 180 160 181 } … … 169 190 mRoot->addFrameListener(mFrameListener); 170 191 mRoot->addFrameListener(&OgreIlluminationManager::getSingleton()); 192 193 171 194 172 195 } -
GTP/trunk/App/Demos/Illum/Ogre/src/ReflectionTest/include/ReflectionTest.h
r1863 r1879 30 30 #include "FrameCapture.h" 31 31 32 int scene = 3;32 int scene = 1; 33 33 FrameCapture* capture; 34 34 … … 311 311 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 312 312 313 mCamera->setPosition(0.532,1.232,1.529); 314 mCamera->lookAt(Vector3(0,1.2,0.0)); 315 316 Entity* object = mSceneMgr->createEntity("object", "teapot.mesh"); 313 mCamera->getParentSceneNode()->translate(1.1,0.8,1.0); 314 //mCamera->lookAt(Vector3(0,1.2,0.0)); 315 316 bool teapot = true; 317 Entity* object; 318 if(teapot) 319 object = mSceneMgr->createEntity("object", "teapot.mesh"); 320 else 321 object = mSceneMgr->createEntity("object", "sphere.mesh"); 322 317 323 object->setMaterialName("MetalTeapotMultipleBounce"); 318 324 objectNode = rootNode->createChildSceneNode("objectNode"); 319 325 objectNode->attachObject(object); 326 if(teapot) 320 327 objectNode->scale(0.5,0.5,0.5); 328 else 329 objectNode->scale(0.005,0.005,0.005); 321 330 //objectNode->scale(0.005,0.005,0.005); 322 331 objectNode->setPosition(0,1.2,0);
Note: See TracChangeset
for help on using the changeset viewer.