PavePave
Home
Guide
API
Sandbox
  • English
  • 日本語
GitHub
Home
Guide
API
Sandbox
  • English
  • 日本語
GitHub
  • Distort

@baku89/pave v0.7.1


@baku89/pave / Distort

Distort

A collection of functions to generate distortion functions.

Functions

fromPointTransformer()

fromPointTransformer(fn): Distort

Defined in: Distort.ts:10

Parameters

ParameterType
fn(p) => vec2

Returns

Distort


twirl()

twirl(center, radius, angle, ramp): Distort

Defined in: Distort.ts:66

Add a twirl distortion to the given point.

Parameters

ParameterTypeDescription
centervec2The center of the twirl.
radiusnumberThe radius of the twirl.
anglenumberThe angle of the twirl in degrees.
ramp(t) => numberThe ramp function that maps the distance ratio to the twirl amplitude.

Returns

Distort

The twirl distortion function.


wave()

wave(amplitude, width, phase, angle, origin): Distort

Defined in: Distort.ts:34

Add a sine wave distortion to the given point.

Parameters

ParameterTypeDefault valueDescription
amplitudenumberundefinedThe amplitude of the wave.
widthnumberundefinedThe wavelength of the wave.
phasenumber0The phase of the wave in degrees.
anglenumber0The angle of the wave in degrees.
originvec2vec2.zeroThe origin of the wave.

Returns

Distort

The wave distortion function.

Edit this page