16.particle

终于到了最后一节:粒子系统~惯例,直接上代码~

首先是创建粒子系统的代码~

		Ogre::ParticleSystem* partSystem1 = _sceneManager ->createParticleSystem("Firework1", "Firework");
		Ogre::SceneNode* node1 = _sceneManager ->getRootSceneNode() ->createChildSceneNode(Ogre::Vector3(0, 10, 0));
		node1 ->attachObject(partSystem1);
然后是几个脚本的例子~

particle_system Firework
{
	material	Examples/Smoke
	particle_width	10
	particle_height	10
	quota		5000
	billboard_type	point

	emitter Point
	{
		emission_rate 100
		direction 0 1 0
		velocity 50
		angle 360
		duration 0.1
		repeat_delay	 1
		colour_range_start 0 0 0
		colour_range_end 1 1 1
	}
}

particle_system MySmoke1
{
	material	Examples/Smoke
	particle_width	10
	particle_height	10
	quota		500
	billboard_type	point

	emitter Ring
	{
		height 50
		width 50
		inner_height 0.9
		inner_width 0.9
		emission_rate 50
		direction 0 1 0
		velocity 20
	}
}

particle_system MySmoke2
{
	material	Examples/Smoke
	particle_width	10
	particle_height	10
	quota		500
	billboard_type	point

	emitter Box
	{
		height 50
		width 50
		depth 50
		emission_rate 10
		direction 0 1 0
		velocity 20
	}
}

particle_system MySmoke3
{
	material	Examples/Smoke
	particle_width	10
	particle_height	10
	quota		500
	billboard_type	point

	emitter Point
	{
		emission_rate 30
		direction 1 0 0
		velocity	20
		time_to_live 4
		angle 30
	}
	affector DeflectorPlane
	{
		plane_point 0 20 0
		plane_normal 0 -1 0
		bounce 1.0
	}
}
其中affector用来动态改变粒子的各种属性,有:Scaler,ColourFader,ColourInterpolator,DirectionRandomiser,还有上面的DeflectorPlane

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值