|
//node = osgDB::readNodeFile("D:\\share\\terrain\\terrain.ive");
osg::Node *node = osgDB::readNodeFile("D:\\d.ive");
TextureVisitor textureTV;
node->accept( textureTV );
std::map<std::string, osg::Image*> imageList = textureTV.getImages();
std::map<std::string, osg::Image*>::iterator iter = imageList.begin();
unsigned int cnt = 0;
char* buffer = new char[2000];
for( ;iter != imageList.end(); iter++ )
{
sprintf(buffer, "d:\\TextureImage%d.bmp", cnt++ );
std::string str = iter->first;
osg::Image* img = iter->second;
unsigned int aaa = img->getTotalSizeInBytes();
aaa = img->getPixelSizeInBits();
osgDB::writeImageFile(*(iter->second), buffer);
}
其它代码类似OSG编程入门指南 6.2.4
读入.osg文件时可以正确取得,但是读入.ive文件就不行(获取图像不正确 有哪位知道原因吗? |
|