视点坐标及鼠标交点坐标的信息显示(七)
核心函数如下:
void COSGObject::addViewPointLabel()
{//mRoot->addChild(osgEarth::Util::Controls::ControlCanvas::get(mViewer));//放开这句,球就卡住了。 为什么,shitosgEarth::Util::Controls::ControlCanvas* canvas = osgEarth::Util::Controls::ControlCanvas::get(mViewer);//添加控件,用来显示视点信息osgEarth::Util::Controls::LabelControl* viewCoords = new osgEarth::Util::Controls::LabelControl("TestViewPoint", osg::Vec4(1.0, 1.0, 1.0, 1.0));viewCoords->setHorizAlign(osgEarth::Util::Controls::Control::ALIGN_LEFT);viewCoords->setVertAlign(osgEarth::Util::Controls::Control::ALIGN_TOP);viewCoords->setBackColor(0, 0, 0, 1.0);viewCoords->setSize(800, 50);viewCoords->setMargin(10);canv