Top down 2D waves
I am working on a sim game (in almost real time). There is a view that draws islands in an ocean. What I want to do is add some waves or whitecaps to the ocean to give the game some more eye candy. The view is zoomed way out so the waves don''t need to be very detailed. I don''t need anything hard core or super realistic, I''m basically looking for a simple way of simulating some waves in a solid blue ocean. I looked for some tutorials but didn''t find anything relevant.
I was thinking of randomly drawing blobs of darker and lighter blue (using a heightmap?) over the ocean before I render the islands.
This sounds like a graphics/rendering/OpenGL/DirectX question, not a physics question...
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Yes, for our last game we just used movies, i.e. animated textures, for water and waves. Worked pretty well and was far from zoomed out. I would only bother with simulation if your doing a game which takes place in the water, such as a water skiing simulator.
John BlackburneProgrammer, The Pitbull Syndicate
I think you can get cool rippling wave effects using a simple wave equation.
dh/dt = k * laplacian(h)
Where h is the height field, k is just some constant you choose that will depend on gravity, scale, etc.
The laplacian is easy to approximate based on immediate neighbours.
laplacian(x,y) = h(x,y+1) + h(x,y-1) + h(x+1,y) + h(x-1,y) - 4*h(x,y)
"Math is hard" -Barbie
dh/dt = k * laplacian(h)
Where h is the height field, k is just some constant you choose that will depend on gravity, scale, etc.
The laplacian is easy to approximate based on immediate neighbours.
laplacian(x,y) = h(x,y+1) + h(x,y-1) + h(x+1,y) + h(x-1,y) - 4*h(x,y)
"Math is hard" -Barbie
"Math is hard" -Barbie
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement