未经处理的异常: 0xC0000005: 读取位置 发生冲突
#include <osgDB/ReadFile>#include <osgViewer/Viewer>
#include <osgParticle/PrecipitationEffect>
#include <osg/Node>
void main()
{
osgViewer::Viewer viewer;
//设置雪花类
osg::ref_ptr<osgParticle::PrecipitationEffect> precipitationEffect = new osgParticle::PrecipitationEffect;
//设置雪花浓度
precipitationEffect->snow(0.5);
//设置雪花颜色
precipitationEffect->setParticleColor(osg::Vec4(1, 1, 1, 1));
//设置风向
precipitationEffect->setWind(osg::Vec3(2, 0, 0));
osg::Group * root = new osg::Group() ;
//把雪花加入到场景结点
root ->addChild(precipitationEffect.get ()) ;
osg::Node* ceep = osgDB::readNodeFile("ceep.ive") ;
root ->addChild(ceep) ;
viewer.setSceneData(root);
viewer.realize();
viewer.run();
}
同样出现这个问题,不知道楼主解决了没? 不是报的空指针的问题吗?
页:
[1]