1 / 8

Building Blocks

Building Blocks. SceneManager (sm) Track everything on screen. Implication: Must create everything through sm Must have methods for creating objects Entity – renderable on screen (a mesh), created by calling method on sm SceneNode – created by calling method on the sm

steffi
Download Presentation

Building Blocks

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. Building Blocks • SceneManager (sm) • Track everything on screen. Implication: • Must create everything through sm • Must have methods for creating objects • Entity – renderable on screen (a mesh), created by calling method on sm • SceneNode – created by calling method on the sm • Camera – created by calling a method on the sm

  2. Vectors and Colour • ogre.Vector3(x, y, z)) • (x, y, z) in pythonOgre • ogre.ColourValue(R, G, B) • (R, G, B) in pythonOgre

  3. Entity • Visibility • setVisible(False) • Bool isVisible() … • Name • getName() - readOnly, cannot change after creation • getParentSceneNode() - what scene node am I attached to

  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)

More Related