Add before the endScene().
Code: Select all
// set to full viewport
driver->setViewPort(rect<s32>(0,0,ResX,ResY));
irr::scene::ISceneCollisionManager* Coll = device->getSceneManager()->getSceneCollisionManager();
core::position2di textPos = Coll->getScreenCoordinatesFrom3DPosition(textPos3d, camera[3]);
// now reverting the viewport calculation for camera 3
textPos.X *= 0.5f;
textPos.Y *= 0.5f;
textPos.X += ResX/2;
textPos.Y += ResY/2;
core::rect<s32> r(textPos, core::dimension2d<s32>(1,1));
Font->draw(L"some text", r, video::SColor(255,255,255,255), true, true);