home/ atoms/ 2d-noise-field

2D Perlin noise maps x,y coordinates to smooth organic texture fields

One-dimensional Perlin noise produces a smooth sequence along a single axis. Passing two arguments — noise(xnoise, ynoise) — creates a 2D noise field: a plane where each coordinate maps to a smooth value between 0 and 1, with neighboring positions having similar values. To traverse the field, use nested loops over x and y, incrementing separate noise seeds for each axis. Reset the x seed at the start of each row (like a typewriter carriage return) to correctly tile the 2D field. The returned value can drive any visual property: alpha, size, rotation, color, or 3D displacement. Animating the field by incrementing the base seed each frame creates the illusion of a drifting texture — the camera scrolls over the noise plane.

Examples

Noise as alpha: int alph = int(noise(xnoise, ynoise) * 255); stroke(0, alph); point(x, y); produces a soft cloud-like texture. Noise as rotation: draw a line rotated by noise(xnoise, ynoise) * radians(360) at each grid point — produces a flow-field of oriented strokes.

Assessment

Describe the visual difference between a noise field traversed with increments of 0.01 versus 0.1, and explain why the increment size controls the scale of the texture features.

“Noise in two dimensions isn't much more complicated than it is in one—it's just a matter of shifting perspective, conceptually, from a line to a plane.”
corpus · generative-art-a-practical-guide-using-processing-matt-pears · chunk 22