createNoise2D()
Part of the @remotion/noise
package.
Creates 2D noise. The function takes one argument:
seed
, same as forrandom()
A NoiseFunction2D
is returned:
tsx
import type {NoiseFunction2D } from "@remotion/noise";import {createNoise2D } from "@remotion/noise";constnoise2d :NoiseFunction2D =createNoise2D ("my-seed");constx = 32;consty = 40;console .log (noise2d (x ,y )); // a number in the interval [-1, 1] which corresponds to (x, y) coord.
tsx
import type {NoiseFunction2D } from "@remotion/noise";import {createNoise2D } from "@remotion/noise";constnoise2d :NoiseFunction2D =createNoise2D ("my-seed");constx = 32;consty = 40;console .log (noise2d (x ,y )); // a number in the interval [-1, 1] which corresponds to (x, y) coord.
Credits
Dependency: simplex-noise