Tank Fire Emitter Effect with Flare3D Part1
在亲爱的老婆和可爱的儿子回家去之后,我经历了短暂的伤感,玩命补动漫和闲书之后,终于罹患上呼吸道感染,进而诱发咳喘,现在一大喘气就跟拉风箱似的,呼噜呼噜,也终于打起精神来,继续写博客,今天要记录的是,利用Flare3D为Tank模型制作一个开火的射击效果,很简单,重点在如何利用Flare3D创建粒子效果,并实地在自己的代码中引用它们。
首先,我需要一个意向,于是我找到了下面这张图片,作为我想实现的目标(我命名为炮打菊花)。
[![](https://archive.writeitdown.site/Tank-fire.jpg)](https://archive.writeitdown.site/Tank-fire.jpg)
下面,我需要一个坦克的模型,嗯,可以从网上的免费模型库很方便的获得,这里随便举出一个,俄罗斯的T-90,可以从这里下载到,[tf3dm.com](http://tf3dm.com/3d-models/tank)
得到这个模型之后,我要将其导入到Flare自带的编辑器中,我用的是其中的dae格式,导入时会有一个小错误,原因应该是贴图的路径不正确,只要将对应的贴图素材重新贴好就可以了。
[![](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%2525889.15.48.png)](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%2525889.15.48.png)
官方粒子生成的视频教程在此:
通过反复观摩如下视频:
发现要实现这样的开火效果,应该由两个部分组成,一个是快速喷射的火舌,以及随后消散的烟尘,于是我先构建火舌的部分。
点击Create-->Particles菜单,在场景内生成一个粒子发生器:
[![](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%2525889.40.36.png)](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%2525889.40.36.png)
为了适配粒子效果,我调整了坦克的缩放尺寸到0.5,也就是一半大小,被创建的粒子出现在(0,0,0)的原始坐标处,需要通过拖拽放置到合适的位置,我将它拖拽到炮筒口的位置上,
[![](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%2525889.45.51.png)](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%2525889.45.51.png)
此时的粒子是静止的,点击右下角的小三角播放按钮,让它动起来吧~走你~~
[![](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%2525889.48.30.png)](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%2525889.48.30.png)
下面,打开Properties面板,逐一调节粒子的属性,
Blend Mode --> Additive
Sort Mode -->Oldest First
Number --> 300
Start Size --> 20
做完这些之后,你会得到一片白茫茫的方块在乱舞。
[![](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%2525889.56.23.png)](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%2525889.56.23.png)
下面,将Flare官方包中提供的一个烟雾贴片素材,作为Textue放上去吧,然后你的粒子一下子就爽了有没有,变得开始有型了有没有。
[![](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%25258810.00.10.png)](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%25258810.00.10.png)
下面再调调它的颜色,比较接近开火的黄色:
[![](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%25258810.01.20.png)](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%25258810.01.20.png)
开始有感觉了吧~哼哼~,由于炮弹发射时,是带着强烈的动能的,所以喷射的火舌应该是长条型的,通过设置下面的参数可以获得类似的效果
Energy --> 150,150,200
Gravity --> 0,0,20
Duration --> 0.1
然后你就获得了一个下面的效果:
[![](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%25258810.10.09.png)](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%25258810.10.09.png)
下面,将loop设置为1,表示每次被触发,只播放一个循环,然后通过回放按钮(就是播放按钮左边的那个)来查看它的实际播放效果,已经接近我想要的火舌效果了。
然后来制作烟雾效果的二号粒子。
创建过程如上,设置参数如下图,请自行对照:
[![](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%25258810.22.59.png)](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%25258810.22.59.png)[![](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%25258810.23.13.png)](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%25258810.23.13.png)
然后就有了下面这种效果:
[![](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%25258810.25.52.png)](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%25258810.25.52.png)
下面,需要给这两个粒子一个合适的名字,比如说,smoke和fire,
[![](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%25258810.29.32.png)](https://archive.writeitdown.site/%2525E5%2525B1%25258F%2525E5%2525B9%252595%2525E5%2525BF%2525AB%2525E7%252585%2525A7%2525202014-01-06%252520%2525E4%2525B8%25258B%2525E5%25258D%25258810.29.32.png)
为了让它们在模型被加载的初期不会现实出来,将他们的visible默认设置为false.
下面保存吧。该做代码的部分了。(累了,明天继续)。
另今天成为了EF的学员,口语评定为Intermediate,希望我学成之后,能有一天我和后辈老生常谈时,说起:“我接受的两次社会培训教育都改变了我的人生轨迹。”,我这种不会理财的人,将钱投资给自己的脑袋,还是比较保险的吧。
[![](https://archive.writeitdown.site/L1000268.JPG)](https://archive.writeitdown.site/L1000268.JPG)