osg demo22 conduit 喷泉效果

本文展示了如何利用osgParticle库创建3D喷泉的实现过程。通过定义粒子系统、发射器、放置器、射手和各种操作员,实现了粒子的生命周期、大小、速度、位置、透明度和颜色变化,最终在场景中呈现出动态的喷泉效果。
摘要由CSDN通过智能技术生成
//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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值