任何人有任何想法如何在画布上绘制制作烟花的效果? 有一个在wireworks动态壁纸(免费的应用程序),一个很好的例子。
Anybody has any idea how to make a fireworks effect by drawing on canvas? There is one nice example in wireworks live wallpaper (free app).
在那里,多点移动,并留下足迹像爆炸的明星,并逐渐消失。我认为有某种运动模糊的每个点上移动,而我不知道如何创建。
There, many points move and leave trails in a star like explosion and gradually disappear. I think that there is some kind of motion blur on each point moving, which I am not sure how to create.
任何意见或链接到相关的例子是值得欢迎的。
Any ideas or links to relevant examples are welcome.
推荐答案
这是一个非常抽象的(和有趣的)问题,但过于复杂,详细回答。
That's a very abstract (and interesting) question but far too complex to answer in details.
你真正寻找的可能是一种改进的粒子系统。粒子系统基本上是一个引擎的粒子,其中包括物理引擎。
What you're really looking for is probably a sort of a modified particle system. A particle system is basically an engine for particles that includes a physics engine.
不过,你应该专注于有这些:
However, what you should focus on are these:
内存池模式 - 因为你不希望在运行时分配对象有用的烟花 粒子系统教程 - 伟大的教程是专为Android 粒子系统 - 伟大的,但对于C ++ Memory Pool pattern - useful for fireworks since you don't want to allocate objects during runtime. Particle system tutorial - great and the tutorial is specifically for Android. Particle system - great, but for C++.一旦你建立它(或者得到关于它的理解),你可以很容易地将其转换成画布
系统,虽然的OpenGL
是preferable替代。
Once you built it (or gotten an understanding about it) you can easily convert it to the Canvas
system, although OpenGL
is the preferable alternative.
相关推荐
最新文章