O'Reilly logo

Irrlicht 1.7 Realtime 3D Engine by Aung Sithu Kyaw, Johannes Stein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - animating nodes

Let's dive right in with the source code from the previous example:

  1. Delete the lines node->setPosition(vector3df(0, 0, -30)); and node->setRotation(vector3df(0, 70, 0));.
  2. Change the line where you add the camera to the scene manager to smgr->addCameraSceneNode(0, vector3df(0, 80, -70), vector3df(0, -40, 0));.
  3. Before the line where you added the camera insert the definition ISceneNodeAnimator* anim which is being assigned with smgr->createRotationAnimator(vector3df(0.0f, 0.8f, 0.0f));.
  4. Check if anim has been assigned correctly, then add the animator to node with node->addAnimator(anim);, then drop the animator and set anim to 0.
  5. Compile and run the application. You can now see two meshes rotating with one mesh rotating ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required