After playing a bit with our pixels we are now going to add a split screen
We don't need the whole code from the previous example. So delete the compositor listener and the frame listener.
We need a second camera, so create a pointer to hold it:
private: Ogre::Camera* mCamera2;
The
createScene()
function just needs to create an instance ofSinbad.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); }
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 = mSceneMgr->createCamera("MyCamera1"); mCamera->setPosition(0,10,20); mCamera->lookAt(0,0,0); mCamera->setNearClipDistance(5);
Now use the new camera pointer to store another camera, which looks at the same point but now...