O'Reilly logo

Ogre 3D 1.7 by Felix Kerger

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 — adding a split screen

After playing a bit with our pixels we are now going to add a split screen

  1. We don't need the whole code from the previous example. So delete the compositor listener and the frame listener.
  2. We need a second camera, so create a pointer to hold it:
    private:
    Ogre::Camera* mCamera2;
    
  3. The createScene() function just needs to create an instance of Sinbad.mesh and attach it to a scene node:
    void createScene()
    {
    Ogre::SceneNode* node = mSceneMgr->getRootSceneNode()->createChildSceneNode();
    Ogre::Entity* ent = mSceneMgr->createEntity("Sinbad.mesh");
    node->attachObject(ent);
    }
    
  4. Now we need a createCamera() function in which we create a camera that looks at our model at (0,0,0) from (0,10,20):
    void createCamera() { mCamera ...

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