1 / 18

Game Design and Dev Ogre3D Overview

Game Design and Dev Ogre3D Overview. CSE 786 Prof. Roger Crawfis. Ogre 3D. Base web site: www.ogre3d.org Download and install Notes The SDK just seems to unpack the files where they were, so move to you development area (Programming/SDKs?) The Environment variable (OGRE_HOME) was not set.

fathia
Télécharger la présentation

Game Design and Dev Ogre3D Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Game Design and DevOgre3D Overview CSE 786 Prof. Roger Crawfis

  2. Ogre 3D • Base web site: www.ogre3d.org • Download and install Notes • The SDK just seems to unpack the files where they were, so move to you development area (Programming/SDKs?) • The Environment variable (OGRE_HOME) was not set. • Use this in you Project settings. • Includes Boost and OIS. Does not include CEGUI. • OIS name conflicts with Ogre (Vector3), so never have a: using namespace OIS; • Wiki • Tutorials • API documentation • …

  3. What is Ogre3D? • Object-Oriented • A little old school and the code is getting bloated. • Not very well engineered now. • Some Design Patterns used • Singletons • Managers • Factory Methods

  4. What is Ogre3D? • Plug-In Architecture • Rendering System • Core Features • Enhancements • Dynamically loads dll’s at runtime. • Copy the ones you need over to your repository. • Default framework reads in a config file to determine which plug-ins to load. • Not automatic.

  5. Plug-In Framework • Default Plugins.cfg # Defines plugins to load # Define plugin folder PluginFolder=. # Define plugins Plugin=RenderSystem_Direct3D9_d Plugin=RenderSystem_GL_d Plugin=Plugin_ParticleFX_d Plugin=Plugin_BSPSceneManager_d Plugin=Plugin_CgProgramManager_d Plugin=Plugin_PCZSceneManager_d.dll Plugin=Plugin_OctreeZone_d.dll Plugin=Plugin_OctreeSceneManager_d

  6. Media Resources • Default Resources.cfg file: # Resource locations to be added to the 'boostrap' path # This also contains the minimum you need to use the Ogre example framework [Bootstrap] Zip=../../media/packs/OgreCore.zip # Resource locations to be added to the default path [General] FileSystem=../../media FileSystem=../../media/fonts FileSystem=../../media/materials/programs FileSystem=../../media/materials/scripts FileSystem=../../media/materials/textures FileSystem=../../media/models FileSystem=../../media/overlays FileSystem=../../media/particle FileSystem=../../media/gui FileSystem=../../media/DeferredShadingMedia FileSystem=../../media/PCZAppMedia Zip=../../media/packs/cubemap.zip Zip=../../media/packs/cubemapsJS.zip Zip=../../media/packs/dragon.zip Zip=../../media/packs/fresneldemo.zip Zip=../../media/packs/ogretestmap.zip Zip=../../media/packs/skybox.zip

  7. Core Objects

  8. Startup Sequence • ExampleApplication • Go() • Setup() • Configure() • setupResources() • chooseSceneManager() • createCamera() • createViewport() • createResourceListener() • loadResources() • createScene() • frameStarted/Ended() • createFrameListener() • destroyScene()

  9. Basic Scene • Entity, SceneNode • Camera, lights, shadows • BSP map • Integrated ODE physics • BSP map • Frame listeners

  10. Terrain, sky, fog

  11. CEGUI • Window, panel, scrollbar, listbox, button, static text • Media/gui/ogregui.layout CEGUI::Window* sheet = CEGUI::WindowManager::getSingleton().loadWindowLayout((CEGUI::utf8*)"ogregui.layout"); mGUISystem->setGUISheet(sheet);

  12. Animation • Node animation (camera, light sources) • Skeletal Animation AnimationState *mAnimationState; mAnimationState = ent->getAnimationState("Idle"); mAnimationState->setLoop(true); mAnimationState->setEnabled(true); mAnimationState->addTime(evt.timeSinceLastFrame); mNode->rotate(quat);

  13. Animation • Crowd (instancing vs single entity) InstancedGeometry* batch = new InstancedGeometry(mCamera->getSceneManager(), "robots" ); batch->addEntity(ent, Vector3::ZERO); batch->build(); • Facial animation VertexPoseKeyFrame* manualKeyFrame; manualKeyFrame->addPoseReference(); manualKeyFrame->updatePoseReference ( ushortposeIndex, Realinfluence) 

  14. Picking CEGUI::Point mousePos = CEGUI::MouseCursor::getSingleton().getPosition(); Ray mouseRay = mCamera->getCameraToViewportRay(mousePos.d_x/float(arg.state.width), mousePos.d_y/float(arg.state.height)); mRaySceneQuery->setRay(mouseRay); mRaySceneQuery->setSortByDistance(false); RaySceneQueryResult &result = mRaySceneQuery->execute(); RaySceneQueryResult::iterator mouseRayItr; Vector3 nodePos; for (mouseRayItr = result.begin(); mouseRayItr != result.end(); mouseRayItr++) { if (mouseRayItr->worldFragment) { nodePos = mouseRayItr->worldFragment->singleIntersection; break; } // if }

  15. Particle Effects mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject( mSceneMgr->createParticleSystem("sil", "Examples/sil")); Examples/sil { material Examples/Flare2 particle_width 75 particle_height 100 cull_each false quota 1000 billboard_typeoriented_self // Area emitter emitter Point { angle 30 emission_rate 75 time_to_live 2 direction 0 1 0 velocity_min 250 velocity_max 300 colour_range_start 0 0 0 colour_range_end 1 1 1 } // Gravity affectorLinearForce { force_vector 0 -100 0 force_application add } // Fader affectorColourFader { red -0.5 green -0.5 blue -0.5 } }

  16. Particle Effects

  17. Fire and Smoke affector Rotator { rotation_range_start 0 rotation_range_end 360 rotation_speed_range_start -60 rotation_speed_range_end 200 }

More Related