Fluid affected by tilt

Does anybody know an easy on the resources way of creating a fluid affected by gravity effect. There was an iPhone app early in the days of apps that looked like you we’re drinking a glass of beer as you tipped the phone. I want to create a similar look, as the device tilts, the ‘half full of water screen’ sloshes from side to side. It doesn’t need to be perfect or lots of particles like this example http://developer.coronalabs.com/forum/2011/10/27/liquid-simulation-real-thing-working-corona-sdk

I basically just need to fake it. Any thoughts? [import]uid: 157954 topic_id: 35243 reply_id: 335243[/import]

Hi Brad,
So, this doesn’t need to behave like an actual “liquid”, sloshing around or something? Maybe you just need the surface of this liquid to stay level with “gravity”? I might suggest using a mask over the liquid that stays horizontally level as the device tilts. But maybe this won’t accomplish the look and feel you need?

Brent [import]uid: 200026 topic_id: 35243 reply_id: 140089[/import]

Hi Brent,

That may work. To explain the effect better, the idea is that the user tilts the device left and right to create waves and troughs keeping their character afloat. So the water doesn’t necessarily need buoyancy as such but it does need to be flexible or elastic to create the bulge and trough look. Would using a mask bend like this do you think?

Thanks for the help! [import]uid: 157954 topic_id: 35243 reply_id: 140095[/import]

Hi Brad,
A mask wouldn’t likely accomplish this. So, you might need to follow some kind of physics-based solution like the one you posted… or maybe not that intensive, but along those lines. I wish it was easier, but at this point, there’s not a perfect solution.

Brent [import]uid: 200026 topic_id: 35243 reply_id: 140148[/import]

Hi Brad,
So, this doesn’t need to behave like an actual “liquid”, sloshing around or something? Maybe you just need the surface of this liquid to stay level with “gravity”? I might suggest using a mask over the liquid that stays horizontally level as the device tilts. But maybe this won’t accomplish the look and feel you need?

Brent [import]uid: 200026 topic_id: 35243 reply_id: 140089[/import]

Hi Brent,

That may work. To explain the effect better, the idea is that the user tilts the device left and right to create waves and troughs keeping their character afloat. So the water doesn’t necessarily need buoyancy as such but it does need to be flexible or elastic to create the bulge and trough look. Would using a mask bend like this do you think?

Thanks for the help! [import]uid: 157954 topic_id: 35243 reply_id: 140095[/import]

Hi Brad,
A mask wouldn’t likely accomplish this. So, you might need to follow some kind of physics-based solution like the one you posted… or maybe not that intensive, but along those lines. I wish it was easier, but at this point, there’s not a perfect solution.

Brent [import]uid: 200026 topic_id: 35243 reply_id: 140148[/import]