//Conduit.h #pragma once #include <osgViewer/Viewer> #include <osg/Group> #include <osg/Geode> #include <osgParticle/Particle> #include <osgParticle/PointPlacer> #include <osgParticle/ParticleSystem> #include <osgParticle/ParticleSystemUpdater> #include <osgParticle/ModularProgram> #include <osgParticle/ModularEmitter> #include <osgParticle/RandomRateCounter> #include <osgParticle/RadialShooter> #include <osgParticle/AccelOperator> #include <osgParticle/FluidFrictionOperator> class Conduit { public: Conduit(void); ~Conduit(void); //创建喷泉 osgParticle::ParticleSystem* CreateConduitScene(osg::Group* root); //粒子数目 float m_fTheNum; //粒子大小 float m_fTheSize; //粒子速度 float m_fTheSpeech; //创建喷泉 osg::Node* CreateConduit(osg::Group *root); //喷泉的具体位置 osg::Vec3 m_VecPosition; }; //*********************************************************************************************************************************************** //Conduit.cpp
#include "Conduit.h" Conduit::Conduit(void):m_fTheNum(800),m_fTheSize(0.2),m_fTheSpeech(100) { m_VecPosition.set(15,64,3); } Conduit::~Conduit(void) { } osgParticle::ParticleSystem* Conduit::CreateCondu
osg demo22 conduit 喷泉效果
最新推荐文章于 2024-07-09 09:53:52 发布
本文展示了如何利用osgParticle库创建3D喷泉的实现过程。通过定义粒子系统、发射器、放置器、射手和各种操作员,实现了粒子的生命周期、大小、速度、位置、透明度和颜色变化,最终在场景中呈现出动态的喷泉效果。
摘要由CSDN通过智能技术生成