|
楼主 |
发表于 2014-11-4 14:18:27
|
显示全部楼层
现在采用最小系统法
插件的入口函数 readNode
// -------------------------------------------------------------------------------------
osgDB::ReaderWriter::ReadResult ReaderWriterMSH::readNode(const std::string& file, const osgDB::ReaderWriter::Options* options) const
{
osg::Group* group = NULL;
// 数据解析
group = test();
return group;
}
// -------------------------------------------------------------------------------------
// test 函数进行绘制
osg::Group* ReaderWriterMSH::test() const
{
osg::Group* group = new osg::Group();
osg::Vec3f v1(-1,-1,0);
osg::Vec3f v2(1,-1,0);
osg::Vec3f v3(1,1,0);
osg::Vec3f v4(-1,1,0);
osg::Vec3Array* vx = new osg::Vec3Array();
vx->push_back(v1);
vx->push_back(v2);
vx->push_back(v3);
vx->push_back(v4);
osg::Geometry* geom = new osg::Geometry();
geom->setVertexArray(vx);
geom->addPrimitiveSet(new osg:rawArrays(osg:rimitiveSet:UADS, 0, 4));
osg::Geode* geode = new osg::Geode();
geode->addDrawable(geom);
group->addChild(geode);
return group;
}
结果还是崩溃了..... 搞不明白啊 ..... 没看到哪里有问题啊
|
-
绘制的图形...
|