OGRE Programming - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

OGRE Programming

Description:

Use Quaternion for rotation to keep the Entity facing the direction it is moving ... 3. Create the scene node which is attached with an entity of the robot. ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 7
Provided by: csNct
Category:

less

Transcript and Presenter's Notes

Title: OGRE Programming


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 DemoApplicationcreateScene 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 DemoFrameListenerframeStarted
  • 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 mAnima
tionState mEntity-gtgetAnimationState("Idle") mA
nimationState-gtsetLoop(true) mAnimationState-gtset
Enabled(true) Animate mAnimationState-gtaddTime
(evt.timeSinceLastFrame) Remark use
OgreMeshViewer and view the mesh
6
References http//www.ogre3d.org/wiki/index.php
/Intermediate_Tutorial_1
Write a Comment
User Comments (0)
About PowerShow.com