Simulating a candle flame in Objective C

瘦欲@ 提交于 2019-12-05 18:48:41

You could look at the Nehe tutorial on particle generation:

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=19

It wouldn't be hard to adapt this to produce something that looks like a candle.

(You can embed a GL view inside another view for this.)

For a previous project we had a website that had to "burn" to reveal the new website underneath. This was accomplished by recording the image of a burning piece of paper and then getting someone that was good at graphic manipulation to clean up and loop the video - this was done in Flash.

What you could do is apply this technique to your candle video. Figure out the shots you need to take to simulate all the states you want to create, including tilting and blowing the flame out, and record them. Then pass this off to someone that can create the animation loops.

Obviously something like this is going to cost a bit of money, but it's going to create the best result.

Realistic flames are really hard using a graphic engine and it's going to look fake - unless you've got a large budget.

This isn't really an Objective-C question. What you need is an introduction to writing OpenGL shaders.

You may still be able to use a particle generator in GL and run it in a layer on top of your other interface so you won't have to rip apart your whole app. I have seen some people complain about performance mixing these methodologies, but for a simple case it should work fine.

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