This time we won't modify the createScene()
function; so just leave it as it is with the Sinbad instance and shadows:
Create a new empty function named
createCamera()
in theExampleApplication
class:void createCamera() { }
Create a new camera named
MyCamera1
and assign it to the membermCamera:
mCamera = mSceneMgr->createCamera("MyCamera1");
Set the position of the camera and let it look at the null point:
mCamera->setPosition(0,100,200); mCamera->lookAt(0,0,0); mCamera->setNearClipDistance(5);
Now change the render mode to wireframe modus:
mCamera->setPolygonMode(Ogre::PM_WIREFRAME);
Compile and run the application.
We overrode the createCamera()
function, which initially created a camera and set it to a position. After creation, we set a position and used the lookat()
function to set the camera up to look at the origin. The next step we did was setting the near clipping distance. A camera can only see parts of a 3D scene...