Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / How should I create water effect using physics?

Author
Message
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 21st May 2012 09:07
I want to create water effect with box2d, but I have no idea now. Can anyone give me some tips?

The Miracrea Games
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 21st May 2012 12:09
I would like to know this to...
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st May 2012 12:50
There are a number of sources for this on the internet. I have to say that my own experiments on this proved that it depends what you want to achieve.

One of the box2d demos in the sticky thread was a great way of making objects appear to float on waves.

If you are after a waterfall or a dynamic water effect there are a number of ways of doing this too.

I did one version where I created hundreds of particles with a blue "fuzzy" image with zero friction that worked quite well. If you want surface tension it gets a lot more complicated...

The main question is what kind of water effect are you after?

halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 21st May 2012 13:02
@baxslash, I need the effect that the water fall to ground from the sky. and there is a cup below.

Can I look at your demo?

The Miracrea Games
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st May 2012 13:10
I'll try to look for it. I might not have it any more as it was part of a project I gave up on. The code was very simple.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st May 2012 13:47
Attached is the demo project I started. It's not bad but might need quite a bit of optimisation.

Attachments

Login to view attachments
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 21st May 2012 17:43
@baxslash, I have seen your project. Do you know “Where is My Water"? Do you know how should I make water like that game?

The Miracrea Games
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st May 2012 17:51
The system I made should work something like that. It might need some tweaking though...

Login to post a reply

Server time is: 2024-04-27 13:39:21
Your offset time is: 2024-04-27 13:39:21