representing ocean waves

asked 2017-09-14 09:54:12 -0500

tve gravatar image

I'm working on a simulation of boats on ocean, including waves (and a relatively realistic physics implementation) and one of the things that I'm wondering is how to represent the moving ocean "terrain". I currently use a png terrain heightmap to represent the ocean which has the issue that it's not moving, which is actually OK for certain types of simulation, but not all. I'm wondering about how to make the ocean move. In physics I can get the MeshURI and then access the mesh and modify it using the mesh manager. But that's all gzserver-side and I presume doesn't do anything for gzclient? Do I need to run the ocean wave generation algorithm twice and also modify some mesh (haven't looked where) in the client? Any suggestions overall for how to handle the ocean?

edit retag flag offensive close merge delete

Comments

You should take a look at the uuvsimulator project, as far as I understand they're focused on underwater, but they have nice water surface visuals that move in an open loop https://github.com/uuvsimulator/uuv_simulator .

chapulina gravatar imagechapulina ( 2017-09-14 10:11:31 -0500 )edit

thanks for answering all my questions ;-)

tve gravatar imagetve ( 2017-09-14 22:25:27 -0500 )edit

Mhh, I'm not seeing any water surface modeling there nor any moving surface model.

tve gravatar imagetve ( 2017-09-14 22:55:54 -0500 )edit

The ocean model for example is here: https://github.com/uuvsimulator/uuv_simulator/tree/master/uuv_descriptions/world_models/ocean You'll need to look at other directories for the mesh and material scripts. Note this is only rendering water visuals on gzclient. This is what it looks like: https://youtu.be/6V_TR9i0k1Q?t=24s

chapulina gravatar imagechapulina ( 2017-09-14 23:52:03 -0500 )edit

Interesting, thanks for taking the time to paste the links. I had no idea about GLSL... Food for me to understand :-). Quick question: if you place the viewpoint just above water level, do you see the waves in 3D or is this all "just" making a flat ocean surface have the look of waves from the distance?

tve gravatar imagetve ( 2017-09-15 00:13:19 -0500 )edit
chapulina gravatar imagechapulina ( 2017-09-15 10:45:44 -0500 )edit