Time for action — preparing the scene

We are going to use the last example from the previous chapter:

  1. Remove the line that changes the material of the model. We want it to use its original material:
    ent->setMaterial(Ogre::MaterialManager::getSingleton().getByName("MyMaterial18"));
    
  2. The application class should now look like this:
    class Example69 : public ExampleApplication
    {
    private:
    public:
    void createScene()
    {
    Ogre::SceneNode* node = mSceneMgr->getRootSceneNode()->createChildSceneNode("Node1",Ogre::Vector3(0,0,450));
    Ogre::Entity* ent = mSceneMgr->createEntity("Entity1","Sinbad.mesh");
    node->attachObject(ent);
    }
    };
    
  3. Compile and run the application. You should see an instance of Sinbad rendered with its normal material.

What just happened?

We created ...

Get Ogre 3D 1.7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.