求助,OE开发浏览器AcitveX,无法显示IVE模型,而在AcitveX容器中却能显示。
osg::ref_ptr<osg::Node> node1 = new osg::Node();std::string strPath = "http://osgservice.yutuxinxi.com/Mod/kazhumi.IVE";
osgDB::ReaderWriter::ReadResult rr = osgDB::Registry::instance()->readNode(strPath,osgDB::Registry::instance()->getOptions() );
if ( rr.validNode() )
node1 = rr.takeNode();
if (!node1 )
{
m_GetTileObj->m_SystempObj->_Msg("读取模型失败!");
return 0;
}
else
{
node1->setName("我的模型");
}
/de1->setDataVariance( osg::Object::DYNAMIC );
//int CastsShadowTraversalMask=0x2;
/de1->setNodeMask(CastsShadowTraversalMask);
////控制建筑物的位置 比例高度
osg::ref_ptr<osg::MatrixTransform> mthouseSelf;
osg::ref_ptr<osg::MatrixTransform> mthouse;
mthouseSelf = new osg::MatrixTransform;
mthouseSelf->getOrCreateStateSet()->setMode(GL_RESCALE_NORMAL, osg::StateAttribute::ON);
bool yes=mthouseSelf->addChild(node1);
if (!yes)
{
m_GetTileObj->m_SystempObj->_Msg("mthouseSelf添加失败了!");
return 0;
}
mthouse = new osg::MatrixTransform;
yes=mthouse->addChild(mthouseSelf);
if (!yes)
{
m_GetTileObj->m_SystempObj->_Msg("mthouse添加失败了!");
return 0;
}
osg::Matrixd mtTemp;
osg::ref_ptr<osg::CoordinateSystemNode> csn = new osg::CoordinateSystemNode;
csn->setEllipsoidModel(new osg::EllipsoidModel());
csn->getEllipsoidModel()->computeLocalToWorldTransformFromLatLongHeight(osg::DegreesToRadians(34.74769),osg::DegreesToRadians(113.61961),0.0, mtTemp);
mthouse->setMatrix(mtTemp);
osg::Vec3d center;
mapNode->getMapSRS()->transformToWorld(osg::Vec3(113.61961,34.74769,0), center);
//////读取center和dist
osg::ref_ptr<osg::PagedLOD> plod = new osg::PagedLOD;
float m_minRange=0,m_MaxRange=0;
plod->setCenter(center);
//plod->setRange(0, 0,500000.0);
plod->setCenterMode(osg::LOD::USER_DEFINED_CENTER);
yes=plod->addChild(mthouse);
if (!yes)
{
m_GetTileObj->m_SystempObj->_Msg("plod添加失败了!");
return 0;
}
yes=earthPageIveLod->addChild(plod);
if (!yes)
{
m_GetTileObj->m_SystempObj->_Msg("earthPageIveLod添加失败了!");
return 0;
}
本帖最后由 huangzhenyong 于 2014-4-7 13:07 编辑
在浏览器里面就不显示了,请求帮忙!
谁能帮我想想办法。 我已经搞定啦,浏览器跟C/S不一样,呵呵。 huangzhenyong 发表于 2014-4-7 13:41
我已经搞定啦,浏览器跟C/S不一样,呵呵。
我也遇到这种问题了,请问楼主你是如何解决的?
页:
[1]