How to create a smoke effect in iphone?

偶尔善良 提交于 2019-12-10 12:43:26

问题


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?


回答1:


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!




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/2123445/how-to-create-a-smoke-effect-in-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!