This browser has no WebGPU, so the sketch cannot run here. The program is below, and it runs in a current Chrome, Edge or Safari.
Vector Field
Use LATT to evaluate 2D Perlin noise across a field
//////////////////////////////////////////////////////////
// vector-field
// Use LATT to evaluate 2D Perlin noise across a field
// visualize the field with an instance formation
//////////////////////////////////////////////////////////
&coord = add(C, (0, mlt(step, 0.005), 0) ) ;
// sample a rectangular lattice with quintic interpolation
// R provides random values
// D provides local offsets
&perlin = LATT.RECT.QUINTIC[&coord]{
dot(nrm(R), D)
};
&dim = (32,32,1);
#A{
dim = &dim;
run = &perlin;
}
~A{
dim = &dim;
shape = CONE;
i_scl = (0.25, 2, 0.25); // instance scale
i_piv = (0, -0.5, 0); // rotate around the base
i_rot = (0,0, mlt(#A, TWO_PI)); // rotation along Z axis
}