We will use the code that we used before and once again create a new empty method:
setShadowTechnique()
function call from the createCamera()
function. We don't want our scene in wireframe mode. createViewports()
method:void createViewports() { }
Ogre::Viewport* vp = mWindow->addViewport(mCamera);
vp->setBackgroundColour(ColourValue(0.0f,0.0f,1.0f)); mCamera->setAspectRatio(Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
We created a viewport. To do this, we needed to pass a camera to the function. Each viewport can only render the view of one camera, so Ogre 3D enforces that one camera is given during creation. Of course, the camera can be changed later using the appropriate getter and setter functions. The most noticeable change is that the background color changed from black to blue. The reason should be obvious: the new viewport has the background color blue; we set it in step 3. Also in step 3, we set the aspect ratio the aspect ratio describes the ratio between the width and height of a rendered image; in math terms: aspect ratio = width of window divided by height of window.
18.218.239.182