波动起来
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;
}

1.gif

来源:Mathematical Surfaces


首页 我的博客
粤ICP备17103704号