|
OSG里加载Terrian3d的ive地形(从网上下载的)能够正常显示地形,但是如果同时在OSG里加载一个osgCal的cal3d骨骼模型,Terrian3d的ive地形就不见了.
//加载Terrian 3d地形
osg::ref_ptr<osg::Node> goe = osgDB::readNodeFile("D:/OSG/OpenSceneGraph/data/model/geotypic_ive_dds/master.ive");
osg::ref_ptr<osg:ositionAttitudeTransform> pXForm = new osg::PositionAttitudeTransform();
pXForm->setPosition(osg::Vec3d(0.0,0.0,0.0));
pXForm->addChild(goe.get());
m_pRoot->addChild( pXForm.get() );
//加载cal3d骨骼
char* s = getenv("OSG_FILE_PATH");
std::string fn = "D:/OSG/OpenSceneGraph/data/skeleton/paladin/paladin.cfg";
if( pActor->InitSelfActor( fn ) )
{
osg::ref_ptr<osg::PositionAttitudeTransform> actorNode = pActor->CurActorNode();
if( actorNode.valid() )
{
m_pRoot->addChild( actorNode.get() );
}
}
osgUtil::Optimizer optimzer;
optimzer.optimize(m_pRoot.get());
setSceneData(m_pRoot.get());
|
|