How to create Fluid motion in android

3.1k views Asked by At

i need to render Fluid inside a bottle and when the device is rotated

1

There are 1 answers

2
Taranfx On BEST ANSWER

Fluid dynamics isn't a simple topic. The simplest example of fluid flow is 2D, incompressible, irrotational, laminar flow. I'd start by looking into that.

You cannot do it in a week, you'll have to learn it.

You can learn from this java example http://www.jbox2d.org/liquid/ Unless your simulation is very small and 2D, you'll probably need to use a C/C++ library with the NDK to get any reasonable framerate.

Google did release a Physics library based on box2d (using NDK) for android. http://google.github.io/liquidfun/ This could be a good resource to get started but unless you understand Physics well, you won't be able to do much.