OpenGL single circular wave

292 views Asked by At

I am trying to implement a circular wave in OpenGL using Gerstner wave function:

enter image description here

It works fine but all my ground is deformed with more waves and all I want is a single wave propagating from the center to the exterior. I tried to modify the z position for the points where sqrt(x*x + y*y) is between two circles to limit the boundaries of a wave. The two circles the first circle has the radius of wavelength * time and the second has the radius of wavelength * (time + 1), but this still isn't good enough because the circles are expanding slower than the speed of the wave.

1

There are 1 answers

0
Aiman Al-Eryani On BEST ANSWER

When you calculate the boundaries by wavelength * time, you're assuming the wavefront is moving with a speed equal to the wavelength; after 1 unit time, the wavefront will have traveled wavelength units in your calculation.

Try using the wave speed that you used to calculate $\varphi$ instead of wavelength there.