Rodrix
02-07-2006, 08:33 PM
Hi everyone! :)
I am trying to do a shallow water simulation, with waves and etc.
However, I have searched the whole internet and I either find a model that it's either too simple or either too complicated.
This next model works is without waves, and given initial conditions of the old-water matrix, it produces a single wave until the water estabilizes and ends completelly flat. My problem is that to generate another wave i have to change the values of the matrix abruptly and that looks really bad and unrealistic, and waves dissapear...
for y := 1 to height - 1
for x := 1 to width - 1
new-water[y][x] = ((old-water[y-1][x] +
old-water[y+1][x] +
old-water[y][x-1] +
old-water[y][x+1]) / 2) -
new-water[y][x])
new-water[y][x] -= new-water[y][x] shr x
end
end
How can I make a continous moving water?
And is there anywhere I can find a more sophisticated model hat involves turbulences (that is waves with crests). (maybe a Navier-Stockes system simplified with numerical methods... :confused: )
Hope anyone can help me on this one...
Thanks so much in advance!
I am trying to do a shallow water simulation, with waves and etc.
However, I have searched the whole internet and I either find a model that it's either too simple or either too complicated.
This next model works is without waves, and given initial conditions of the old-water matrix, it produces a single wave until the water estabilizes and ends completelly flat. My problem is that to generate another wave i have to change the values of the matrix abruptly and that looks really bad and unrealistic, and waves dissapear...
for y := 1 to height - 1
for x := 1 to width - 1
new-water[y][x] = ((old-water[y-1][x] +
old-water[y+1][x] +
old-water[y][x-1] +
old-water[y][x+1]) / 2) -
new-water[y][x])
new-water[y][x] -= new-water[y][x] shr x
end
end
How can I make a continous moving water?
And is there anywhere I can find a more sophisticated model hat involves turbulences (that is waves with crests). (maybe a Navier-Stockes system simplified with numerical methods... :confused: )
Hope anyone can help me on this one...
Thanks so much in advance!