Download presentation
Presentation is loading. Please wait.
Published byArron Barnett Modified over 8 years ago
1
Unbuffered Input Games generally use unbuffered Input Ogre provides FrameListeners – Ogre's main infinite loop → startRendering – Also called the render loop Render loop has three steps – 1. frameStarted(...) on all REGISTERED frame listeners – 2. Ogre renders one frame – 3. frameEnded(...) on all REGISTERED frame listeners How do you get out of the loop?
2
Render loop and FrameListeners FrameStarted must return True or False If frameStarted(...) returns False, exit render loop In C++: – bool frameStarted(ogre.FrameEvent); You can register multiple frame listeners with ogre. You cannot specify the order in which the frame listeners are called.
3
Registering an frame listener self.frameListener = TutorialFrameListener(self.renderWindow, self.camera, self.sceneManager) self.root.addFrameListener(self.frameListener)
4
SceneNode Position node.translate(ogre.Vector3(50, 50, 0)) yaw, roll, pitch, rotate(quaternion) → orientation Scale Attach/Detach Relative positioning
5
Entity/SceneNode Typical: Create One Entity, Attach to sceneNode Bike with two wheels? Relative positioning Create frame, wheel1, wheel2 Create sceneNode, n1, child of root n1 = sm.createChildSceneNode(...) Attach frame to n1 Create sceneNode, c1, child of n1 c1 = n1.createChildSceneNode(“RobotNode2”, (50, 0, 0)) Attach wheel1 to c1 c1.attachObject(wheel1) Create sceneNode, c2n1, child of n2 Attach wheel2 to c2n1
6
Lights, Cameras, Planes Camera is created by scene manager Since your tutorial code inherits from sample framework, you get a default camera in tutorial1 Cameras have a name! sm.getCamera(name) Cameras have a position Cameras have orientation (lookAt!) SceneNodes have lookAt!
7
Lights Point lights emit light in every direction Spotlight – flashlight/spotlight Directional – very long distance spotlight Light properties Diffuse (matte paint) Specular (glossy)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.