cvex
main(
int curv_idx = 0;
int num_curves = 0;
int seed = 0x13A499;
float radius = 0.2;
float heightscale = 1.0;
export vector displayColor[] = {};
)
{
int num_points = 7 + curv_idx % 5;
vector2
uv = random_brj(0x4AF03^seed, curv_idx);
vector remap = filter_remap(uv, "gauss", radius);
vector2 base = set(remap.x, remap.y);
float w = random_brj(0x72BC9^seed, curv_idx);
height += heightscale * radius * (2 + 2*remap.z);
vector2 peak = random_brj(0x390F0^seed, curv_idx);
peak.x = (base.x *
fit01(peak.x, 1, 2.5)) +
sign(base.x)*0.1;
peak.y = (base.y *
fit01(peak.y, 1, 2.5)) +
sign(base.y)*0.1;
vector dir = set(peak.x - base.x, 0, peak.y - base.y);
float step = dist / 10;
float a = 2 * height /
dist;
float b = height / (dist *
dist);
for (int i = 0; i < num_points; i++)
{
x += step;
points[i] = set(base.x, 0, base.y);
points[i].y = a*x - b*x*
x;
displayColor[i] = set(0.1);
displayColor[i].g =
fit(
float(i), 0, 12.0, 0.2, 0.85);
}
}