如何在android上创建烟花粒子图形效果 [英] How to create fireworks particle graphics effect on android

查看:26
本文介绍了如何在android上创建烟花粒子图形效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何通过在画布上绘画来制作烟花效果吗?在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:

  • 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++.

一旦您构建了它(或了解了它),您就可以轻松地将其转换为 Canvas 系统,尽管 OpenGL 是更好的选择.

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.

这篇关于如何在android上创建烟花粒子图形效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆