iPhone流体模拟 [英] iPhone fluid simulation

查看:199
本文介绍了iPhone流体模拟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道iphone的流体引擎吗?我需要水和气体模拟。

Somebody know fluid engine for iphone?I need water and gases simulation.

推荐答案

模拟流体对现代是一个巨大的挑战台式电脑,所以我不希望在尝试在移动设备上运行时获得最佳性能。在iPhone上运行完整的Navier-Stokes计算可能会非常糟糕。

Simulating fluids is a tremendous challenge for modern desktop computers, so I would not expect the greatest performance when trying to get this working on a mobile device. Running full Navier-Stokes calculations on the iPhone is probably going to chug pretty badly.

然而,在过去,我能够在有限的情况下执行二维流体建模模拟使用格子气自动机的硬件。使用晶格气体自动机,您可以将流体近似为精细的六边形网格,其中粒子可以在六个方向中的一个方向上行进并遵守特定的碰撞规则。这种方法存在一些局限性(由Lattice Boltzmann方法解决),但它可以很好地模拟流体,甚至包括空气等可压缩流体。为什么这在有限的硬件上运行良好,这些计算可以使用按位运算符和简单的查找表来完成,而无需任何浮点计算。你可以在iPhone的处理器上做这样的工作。有关此技术的更多信息,请参阅我的博士的附录A. 。学位论文,在那里我解释了这个过程,并为我写的流体建模师提供了源代码。

However, in the past I was able to perform 2-D fluid modeling simulations on limited hardware using lattice gas automata. With lattice gas automata, you approximate a fluid as a fine hexagonal grid, where particles can travel in one of six directions and obey specific collision rules. There are some limitations to this approach (addressed by the Lattice Boltzmann Method), but it can do a very good job of simulating fluids, even including compressible ones like air. Why this works well on limited hardware is that these calculations can be done using bitwise operators and simple lookup tables, without the need for any floating point calculations. You might be able to make something like this work on the iPhone's processor. For more on this technique, you can consult Appendix A of my Ph.D. dissertation, where I explain the process and have source code for a fluid modeler I wrote.

这就是说,如果你想做的只是模仿外观在您的应用程序中,以下问题的答案提供了一些很好的建议:

That said, if all you want to do is mimic the appearance of water in your application, the answers to the following questions provide some good suggestions:

  • "How to implement water ripples?"
  • "How do I make a water effect view with openGLES on the iPhone?"

这篇关于iPhone流体模拟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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