|
发到osg板块去了,重新发一次:
刚刚开始接触osgearth1个月,要做历史地理影像的播放,从百度上搜到osg::ImageSequence这个类,试了一下,老是报错,不知道有没有更好的方法,这是我的代码:
- void SSDImageSequence::ImageSeqPlayStart(vector<CString> cstrVct)
- {
- osg::ref_ptr< osg::ImageSequence > seq = new osg::ImageSequence();
- seq->setLoopingMode( osg::ImageStream::NO_LOOPING );
- seq->setLength( 10);
- for( int i=0; i<cstrVct.size(); i++ )
- {
- osg::ref_ptr<osg::Image> image = osgDB::readImageFile(cstrVct[i].GetBuffer(cstrVct[i].GetLength()));
- if ( image.get() )
- {
- ImageOverlay* imageOverlay = new ImageOverlay(g_MapNode3DPtr, image);
- imageOverlay->setBounds( Bounds(72.988928571428, 12.211075758883723, 134.98892857142857, 54.21107671255804) );
- g_Root3DPtr->addChild(imageOverlay);
- seq->addImage( image );
- }
- }
- if ( 1)
- seq->play();
- }
复制代码 |
|