Time for action — adding a split screen
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 ...
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.