Water and Wind

I haven’t been working with java very long and everything I’ve done has been working with JME3. I know even less about fluid dynamics.

Can someone point me in the right direction for open body of water fluid dynamics with wind and buoyancy?

Basically, I need to know how to simulate a raft floating on the surface of the ocean in the wind. If someone has already done this or can point me in the right direction that would be awesome.

when you say “simulate” you mean exact simulation? Because this is gonna be very hard.
However if you want to have a raft that looks like it’s floating on a water surface you can give a try to this
http://hub.jmonkeyengine.org/forum/topic/buoyancycontrol-code-to-be-used-with-projectedgrid/

For actual simulations of fluids, check out the Navier stokes equations http://en.wikipedia.org/wiki/Navier–Stokes_equations

They are used to describe pretty much every Newtonian fluid

And if you want to do some real simulation you better have your math in good working order. :smiley:

I don’t mean exact simulation, I’m just looking for enough fakery that it doesn’t all have to be scripted animation.

I want to start with just a life raft in the ocean. Deal with making it float and making a rock sink and some ripples that might show up around it. I’d like to be able to add waves based on wind and have them actually push the boat around in something resembling a realistic way.

Those equations are far above my head. I guess I didn’t realize just what would be involved in dealing with fluids.

@angellus00 said: Those equations are far above my head. I guess I didn't realize just what would be involved in dealing with fluids.

Since you seem to want to fake it, it wouldn’t have anything to do with fluids.

Generally it shouldn’t be a problem visually unless there is nothing else to see on the screen. In short, the more time people have to look at it, the more flaws they will find. Obviously. Of course if the raft goes up when it’s between two crests… Well… :wink:

But the general rule is we have a lot of leeway when it comes to it. These, after all, are only games. Not a 1 to 1 modelisation of real life.

1 Like
@madjack said: Since you seem to want to fake it, it wouldn't have anything to do with fluids.

Generally it shouldn’t be a problem visually unless there is nothing else to see on the screen. In short, the more time people have to look at it, the more flaws they will find. Obviously. Of course if the raft goes up when it’s between two crests… Well… :wink:

But the general rule is we have a lot of leeway when it comes to it. These, after all, are only games. Not a 1 to 1 modelisation of real life.

I’d rather not fake it if I can avoid it because I want it to look really good. The core of the game idea will be dealing with water and will open with a life raft on the open ocean. I’d really prefer to find a library that does the complex fluid dynamics maths for me but if I can’t I guess I need to start studying.

@Husky post, as mentioned by Nehon is the closest I’ve seen here in the forums about this. I know he posted one or two follow-up on this with better result. You might also want to contact him.

Honestly, faking it is the way forwards here.

You don’t need fluid dynamics, you just need wave propagation. Run the waves, modify the buoyancy of the raft and the ocean surface meshes appropriately, etc.

Try searching the forums, there are a couple of examples of ships in the ocean that will help you out.

@angellus00 said: I'd rather not fake it if I can avoid it because I want it to look really good. The core of the game idea will be dealing with water and will open with a life raft on the open ocean. I'd really prefer to find a library that does the complex fluid dynamics maths for me but if I can't I guess I need to start studying.

Regardless of what you do, I think you will end up “faking it” on some level. I doubt you want to simulate your raft as a billion particles (and even that would be an approximation) just to calculate accurate buoyancy, for example.

So you will end up compromising in a dozen places… I think what you want is for it to look right… not be right.