1 / 6

OGRE Programming

Learn how to animate and move an entity in Ogre programming, including walking between predefined points and using quaternion for rotation. This tutorial covers setting up the scene, animating the robot based on its state, and translating it between locations.

jvogl
Télécharger la présentation

OGRE Programming

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. OGRE Programming

  2. Contents • Take an Entity • Animate it • Have it walk between predefined points. • Use Quaternion for rotation to keep the Entity facing the direction it is moving 2

  3. Setting up the scene In DemoApplication::createScene: 1. Set the default lighting. 2. Create the entity for the robot 3. Create the scene node which is attached with an entity of the robot. 4. Create the walking list which consists of a set of locations (i.e. points) 5. Create objects for the locations specified by the walking list. 6. Set the camera to look at the scene.

  4. Animating and Moving the Robot • In DemoFrameListener::frameStarted • There are three items that we have to do. • Animate the robot according to the state of the robot: • “idle” and “walk” • 2. Translate the robot from one location to another location • using interpolation method. • 3. If the facing direction of the robot is not consistent • with the walking direction, the orientation of the robot • should be changed.

  5. Animating the robot based on its state Set state: AnimationState *mAnimationState; mAnimationState = mEntity->getAnimationState("Idle"); mAnimationState->setLoop(true); mAnimationState->setEnabled(true); Animate: mAnimationState->addTime(evt.timeSinceLastFrame); Remark: use OgreMeshViewer and view the mesh

  6. References: http://www.ogre3d.org/wiki/index.php/Intermediate_Tutorial_1

More Related