ColorGrid
Generates a color grid mesh based on specified parameters. A color grid is essentially a set of small rectangles, and each rectangle in the grid gets its color from a user provided function. Moreover, you can mask out only a subset of the rectangles to be shown. The key feature is that this all provided in a single mesh, which basically makes this significantly more perfamant than creating 10000 rectangles as you might do otherwise.
A color grid is extremely versatile and we recommend you play around with it. In particular, it's great for creating parameteric surfaces in conjunction with PointMapped (this is how the Monocurl log was created). You might also want to refer to keyframe_lerp for help on creating gradients.
x_min | Define the minimum x-coordinate of the grid |
x_max | Define the maximum x-coordinate of the grid |
y_min | Define the minimum y-coordinate of the grid |
y_max | Define the maximum y-coordinate of the grid |
x_min | Define the minimum x-coordinate of the grid |
x_max | Define the maximum x-coordinate of the grid |
y_min | Define the minimum y-coordinate of the grid |
y_max | Define the maximum y-coordinate of the grid |
x_step | Define the step size for x-coordinate (how wide each sub rectangle should be) |
y_step | Define the step size for y-coordinate (how tall each sub rectangle should be) |
x_min | Define the minimum x-coordinate of the grid |
x_max | Define the maximum x-coordinate of the grid |
y_min | Define the minimum y-coordinate of the grid |
y_max | Define the maximum y-coordinate of the grid |
x_step | Define the step size for x-coordinate (how wide each sub rectangle should be) |
y_step | Define the step size for y-coordinate (how tall each sub rectangle should be) |
mask(pos) | Function to define mask for specific positions (whether or not a sub rectangle should be included or not). Return 1 if it should be used, and zero otherwise. |
tag | A vector of numbers used as the mesh's tag |
color_at(pos) | Function to define color at specific positions. Pos is a 3-vector consisting of the global x, y, and z positions. |
color_at(pos) | Function to define color at specific positions. Pos is a 3-vector consisting of the global x, y, and z positions. |
stroke | A 4-vector representing the color of the grid's stroke (defaults to white) |
a color grid mesh based on the above specification
func ColorGrid([points] {[main] {x_min, x_max, y_min, y_max}, [step] {x_min, x_max, y_min, y_max, x_step, y_step}, [mask] {x_min, x_max, y_min, y_max, x_step, y_step, mask(pos)}}, tag, [color] {[auto_stroke] {color_at(pos)}, [custom_stroke] {color_at(pos), stroke}})