1、绘制一个八个瓣的花朵:pixels = W:1024 H:1024x = from -1.0 to 1.0 Wy = from -1.0 to 1.0 Hdis = 0.35 + 0.2*cos(atan2(y,x)*8.0 +2.4)k = smoothstep(dis, dis+0.3, sqrt(x*x + y*y))r = 0.44*k + smoothstep(0.25, 0.89, dis)g = 0.4*k + smoothstep(0.25, 0.89, dis)b = 0.9*k
2、改变一下“花儿”的颜色:r = 3.6*k + smoothstep(0.25, 0.89, dis)g = 0.6*k + smoothstep(0.25, 0.89, dis)b = 0.9*k
3、绘制一朵六瓣花,只要把dis的参数修改一下:dis = 0.35 + 0.2*cos(atan2(y,x)*6.0 +2.4)
4、还可以绘制一朵五瓣花:dis = 0.35 + 0.2*cos(atan2(y,x)*5.0 +2.4)
5、如果把花瓣的参数改为365,图形就会显得不那么美观了:dis = 0.35 + 0.2*cos(atan2(y,x)*365.0 +2.4)
6、完整的图形如下所示,只不过百度经验会把图片压缩很小,无法看到细节。