|
本帖最后由 zhmhd 于 2010-3-5 21:39 编辑
我是用的StepIntoOsg里的模拟烟雾效果的代码
这是生成烟雾的代码
- void CreateFire(osg::Group* root)
- {
- osg::Vec3 wind(1.0f,0.0f,0.0f);
- osg::Vec3 position(0,0,0);
- osgParticle::ExplosionEffect* explosion=new osgParticle::ExplosionEffect(position,1.0f);
- osgParticle::ExplosionDebrisEffect* explosionDebri=new osgParticle::ExplosionDebrisEffect(position,1.0f);
- osgParticle::SmokeEffect* smoke=new osgParticle::SmokeEffect(position,1.0f);
- osgParticle::FireEffect* fire=new osgParticle::FireEffect(position,1.0f,5.0f);
- explosion->setWind(wind);
- explosionDebri->setWind(wind);
- smoke->setWind(wind);
- fire->setWind(wind);
- root->addChild(explosion);
- root->addChild(explosionDebri);
- root->addChild(smoke);
- //root->addChild(fire);
- }
复制代码
程序可以成功运行,但是生成的烟雾效果如图
为什么烟雾会是一个一个小方块呢?
file:///C:/Users/zhm/AppData/Local/Temp/moz-screenshot.png |
|