static float Ripple(float x,float z,float t){ float d = Mathf.Sqrt (x * x + z * z);//计算距离,波动影响因子 float f = Mathf.Sin(Mathf.PI *(4 * d - t));//4为波段,π为1个波段 f /= 1 + 10* d;//减小振幅,d越小,振幅越大,也就是中心振幅大 return f; }
来源:Mathematical Surfaces