画中画

void BaseApplication::createCamera(void) { // 主窗口摄像机 mCamera_1 = mSceneMgr->createCamera("Cam_1"); mCamera_1->setPosition(Vector3(0,0,300)); mCamera_1->lookAt(Vector3(0,0,-300)); mCamera_1->setNearClipDistance(5); // 画中画摄像机 mCamera_2 = mSceneMgr->createCamera("Cam_2"); mCamera_2->setPosition(Vector3(100,100,300)); mCamera_2->lookAt(Vector3(-100,-100,-300)); mCamera_2->setNearClipDistance(5); }

void BaseApplication::createViewports(void) { // 主窗口 Viewport* vp_1 = mWindow->addViewport( mCamera_1 ); vp_1->setBackgroundColour( ColourValue(0,0,0) ); mCamera_1->setAspectRatio( Real( vp_1->getActualWidth() ) / Real( vp_1->getActualHeight() ) ); // 画中画 Viewport* vp_2 = mWindow->addViewport( mCamera_2, 1, 0.7, 0.05, 0.25, 0.25 ); vp_2->setBackgroundColour( ColourValue(0,0,0) ); vp_2->setOverlaysEnabled(false); mCamera_2->setAspectRatio( Real( vp_2->getActualWidth() ) / Real(vp_2->getActualHeight() ) ); }  

你可能感兴趣的:(画中画)