如何在iphone中制作烟雾效果?
我正在开发一个应用程序,我想要做一些烟雾效果,例如动画并与烟雾交互。
我需要实现它 OpenGLES 还是任何简单的解决方案?
有没有相关的示例应用程序?
i am developing an application where i want to do some smoke effect like animation and interact with that smoke.
Do i need to implement it OpenGLES or any simple solution?
Is there any sample application for it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以为此编写一个简单的粒子发射器。是为了游戏吗?或另一种应用程序?
它还取决于您正在寻找的现实主义水平。一个人因为提到流体动力学而被投票,但如果你真的想要真实感,那是最好的选择。
话虽如此,您确实可以使用常规粒子发射器获得不错的烟雾(您甚至可以尝试在 Core Animation 上编码,而不是在 OpenGL ES 中编码)。
另外,如果您的目标是 iOS 5.0+,UIKit 现在包含多个您可以使用的粒子 FX,您只需使用参数即可...查看此 教程
干杯!
You could just write a simple particle emitter for that. Is it for a Game ? or for another kind of Application ?
It also depends on the level of realism that you're looking for. A guy got down voted for mentioning fluid dynamics, but if you really want realism, that's the best way to go.
Having said that, you can really get decent smoke using a regular particle emitter (you could even try to code it on Core Animation and not in OpenGL ES).
Also, if you're targeting iOS 5.0+, UIKit now includes several Particle FX that you could use, you just have to play with the parameters... checkout this tutorial
Cheers!
是的,通过简单的解决方案就可以实现。你只需要使用 UIKit 粒子系统即可。
看看示例https://github.com/lichtschlag/Dazzle,你只需要检查火和烟雾样本。
祝你好运
Yes, its possible with simple solution. You just need to use UIKit particle system.
Have a look that sample https://github.com/lichtschlag/Dazzle, you just need to check fire and smoke sample.
Good luck
嗯...我对OpenGLES一无所知,但是有一个名为iProcessing的替代方案旨在为iOS创建本机交互式应用程序,实际上没有iOS版本5,实际上是iOS 4和iOS 3,也许我们可以等待他们发布新版本iOS 5 版本。
您需要一台 Mac 才能使用 Xcode,iProcessing 包包含 Xcode 的示例项目。
http://luckybite.com/iprocessing/
老实说,我还没有尝试过,但你可以比较一下交互式烟雾的代码 http://processing.org/learning/topics/smoke.html。
处理非常棒,因为您可以对 Processing.js 和 iProcessing 使用相同的代码,但这取决于导入 OpenGL 等库。
Hmmm... i have no knowledge about OpenGLES, but there an alternative called iProcessing is designed to create native interactive apps for iOS, actually there no iOS version 5, actually are iOS 4 and iOS 3, maybe we can wait when they release new version of iOS 5.
You need a mac to use Xcode, iProcessing package includes sample projects for Xcode.
http://luckybite.com/iprocessing/
Honestly, i haven't tried it, but you can compare this code of the interactive smoke http://processing.org/learning/topics/smoke.html.
Processing is awesome because you can use same codes for Processing.js and iProcessing, but it depends like importing libraries like OpenGL, etc.