Exercises
- Change the direction the waves move from towards the center to away from the center
改变波浪方向使从中心向远离中心方向移动
vector pos = @P * chv("fancyscale");
vector center = chv("center");
float d = distance(pos, center) ;
d *= ch("scale");
float color = fit(sin(d - @Time), -1, 1, 0, 1);
@Cd = color;
2. Change the speed of the wave
改变波浪速度
//给@Time添加一个系数控制速度
vector pos = @P * chv("fancyscale");
vector center = chv("center");
float d = distance(pos, center) ;
d *= ch("scale");
float color = fit(sin(d - 10*@Time), -1, 1, 0, 1);
@Cd = color;
- Make the waves be blue on black, or yellow on green
给波浪加颜色(蓝黑,黄绿),这里原理就是控制rgb三个值的变换,在Photoshop的色卡里面看颜色值测试一下
vector pos = @P * chv("fancyscale");
vector center = chv("center");
float d = distance(pos, center) ;
d *= ch("scale");
float blue = fit(sin(d - @Time),-1,1,0,1);
@Cd = set(0,0,blue);
vector pos = @P * chv("fancyscale");
vector center = chv("center");
float d = distance(pos, center) ;
d *= ch("scale");
float blue = fit(sin(d - @Time),-1,1,0,1);
@Cd = set(blue,0.7,0);
- Rather than affect colour, make them affect the y position of the points.
将点的y值改为动态,可以修改通道Fancyscale和Center来实现一些不同的效果,添加speed控制速度
vector pos = @P * chv("fancyscale");
vector center = chv("center");
float d = distance(pos, center) ;
d *= ch("scale");
float blue = fit(sin(d - @Time*ch("speed")),-1,1,0,1);
float green = fit(sin(d - @Time*ch("speed")),-1,1,1,0);
@Cd = set(0,green,blue);
@P.y += blue;
瞎整了几个函数,理论上来说可以实现任何线性变换,感觉可深入的空间还很大