SE Team 9 3D Flyer

Post on 06-Jan-2016

26 views 0 download

description

SE Team 9 3D Flyer. Cole Hoosier Ryan Hannebaum Leanne Gray Alex Stampbach Matt Cook. Project Statement. GlobalFlyer allows a player to fly a Wright brothers-style airplane in 3D space using the OGRE graphic rendering engine and the FMOD sound system. Presentation Outline. Introduction - PowerPoint PPT Presentation

Transcript of SE Team 9 3D Flyer

SE Team 93D Flyer

Cole HoosierRyan Hannebaum

Leanne GrayAlex Stampbach

Matt Cook

Project Statement

• GlobalFlyer allows a player to fly a Wright brothers-style airplane in 3D space using the OGRE graphic rendering engine and the FMOD sound system.

Presentation Outline

I. Introduction

II. Review of web page (including goals)

III. Overview of OGRE

IV. GlobalFlyer software design

V. Project plan evaluation

VI. Conclusion

GlobalFlyer Web Site

• http://seteam9.cis.ksu.edu/

Overview of OGRE

Common Function/Classes in Ogre

• root• sceneManager• sceneNode• Entity• Camera/viewPort• light• frameListener• eventProcessor

root

• Constructor–Root(pluginFileName, configFileName, logFileName)

• Some Functions–SceneManager* getCurrentSceneManager(void)–void addFrameListener(FrameListener *)–void startRendering(void)–void shutdown(void)–RenderWindow* initialise(bool, “OGRE Render Window””)

sceneManager

• Constructor– SceneManager(“[nstance name”)

• Some Functions– Camera* createCamera(“name”)– Light* createLight(“name”)– SceneNode* getRootSceneNode(void)– SceneNode* createSceneNode(“name”)– Entity* createEntity(“name”)– void setAmbientLight(ColourValue)– void setWorldGeogmetry(“filename”)– void setSkyPlane(bool, Plane, “materialName”, scale,…)– void showBoundingBoxes(bool)– void setShadowTechnique(ShadowTechnique)– Viewport* getCurrentViewport(void)

sceneNode

• Constructor– SceneNode(SceneManager, “name”)

» Only called by creator SceneManager

• Some Functions– void attachObject(MovableObject)

– SceneNode* createChildSceneNode(Vector3, Quatrernion)

– void setOrientation(w,x,y,z)

– void setDirection(x,y,z, TransformSpace, Vector3)

– void lookAt(Vector3, TransformSpace, Vector3)

– void scale(Vector3)

– void addChild(Node*)

– void setListener(Listener*)

Entity

• Inherits from MovableObject– ShadowCaster– AnimableObject

• ConstructorEntity(“Name”, MeshPtr)

• Some Functions– sceneManager _getManager(void)– void setCastShadows(bool)– sceneNode getParentSceneNode(void)

Camera/viewPort

• Camera(“Name”, SceneManager)– void setPosition(Vector3)– void lookAt(Vector3)– setFocalLength(Real)

• Viewport(Camera, RenderTarget, Real…)– RenderTarget* getTarget(void)– Camera* getCamera(void)– void setDimensions(real, real, real, real)– void setBackGroundColour(ColourValue)– void setShadowsEnabled(bool)– void setSkiesEnabled(bool)

Light

• Inherits from MovableObject• Constructor

– Light (“name”)

• someMethods– void setType(LightTypes)

• Spotlight, Point, Directional

– void setDiffuseColour(real, real, real)– void setSpecularColour(real, real, real)– void setAttenuation(real, real, real, real)

frameListener

• Detailed Description Later

• Has 2 public Methods– Bool frameStarted(FrameEvent)– Bool FrameEnded(FrameEvent)

eventProcessor

• void startProcessingEvents(bool)

• bool frameStarted(FrameEvent)

• void addEventTarget(EventTarget*)

• void addMouseListener(MouseListener*)

• void addKeyListener(KeyListener*)

• void processKeyEvent(KeyEvent*)

Ogre FrameListeners

• Not just for kids anymore!

• Featuring code examples from– OgreWiki– OgreAPI

Root::startRendering

• Calls the frameStarted method on all registered FrameListeners

• Renders one frame

• Calls the frameEnded method on all registered FrameListeners

– This continues until one of these methods returns False

FrameListener Class

• struct FrameEvent– timeSinceLastEvent– timeSinceLastFrame

• frameStarted

• frameEnded

Safety Notice

• Ogre chooses the order in which it executes frameStarted and frameEnded

• User cannot dictate this order

• Nesting FrameListener’s is one way to get around this

Exampleclass TutorialFrameListener : public ExampleFrameListener { public:

TutorialFrameListener( RenderWindow* win, Camera* cam, SceneManager *sceneMgr )  : ExampleFrameListener(win, cam, false, false)

{ }

bool frameStarted(const FrameEvent &evt) //This function is where you place actions{

return ExampleFrameListener::frameStarted( evt ); }

bool frameEnded(const FrameEvent &evt) //This function is where you place actions{

return ExampleFrameListener::frameEnded( evt ); }

protected: bool mMouseDown; // Whether or not the left mouse button was down last frame Real mToggle; // The time left until next toggle Real mRotate; // The rotate constant Real mMove; // The movement constant SceneManager *mSceneMgr; // The current SceneManager SceneNode *mCamNode; // The SceneNode the camera is currently attached to

};

There Can be only One!

• Code can be placed in either:– frameStarted– frameEnded

• But, there is only ONE render-cycle per frame– Changes don’t render between frameEnded and

frameStarted• So, if frameEnded has a movement that frameStarted

negates, the movement will not show

Creating a FrameListener• Example:

: ExampleFrameListener(win, cam, false, false) //Window, Camera, buffered key input, buffered mouse input

• Example:// Create the FrameListener

mFrameListener = new TutorialFrameListener(mWindow, mCamera, mSceneMgr);

mRoot->addFrameListener(mFrameListener);

User Interaction

• Arrow keys• Spacebar• F1, F2, F3• Adding mouse

support for camera rotation

GlobalFlyer software design

FrameStarted Sequence Diag

Project Plan

Physics

Lighting

Sky

Testing

Presentation 3

Tutorials

Matt17%

Cole20%

Ryan18%

Leanne20%

Alex25%

Ryan

Leanne

Alex

Cole

Matt

Tasks up to present

Task estimation vs. actual time

0100

200300

400500

600700

800900

Actual

Estimation

Task

Minutes

Upcoming Tasks

Conclusion• Goals for next presentation

– Make physics engine– Improve lighting– Fix sky

Who has Questions?

-Images from texasbestgrok.mu.nu/images/GF2.jpg