@baku89/pave / Distort
Distort
A collection of functions to generate distortion functions.
Functions
fromPointTransformer()
fromPointTransformer(
fn
):Distort
Defined in: Distort.ts:10
Parameters
Parameter | Type |
---|---|
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
Parameter | Type | Description |
---|---|---|
center | vec2 | The center of the twirl. |
radius | number | The radius of the twirl. |
angle | number | The angle of the twirl in degrees. |
ramp | (t ) => number | The 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
Parameter | Type | Default value | Description |
---|---|---|---|
amplitude | number | undefined | The amplitude of the wave. |
width | number | undefined | The wavelength of the wave. |
phase | number | 0 | The phase of the wave in degrees. |
angle | number | 0 | The angle of the wave in degrees. |
origin | vec2 | vec2.zero | The origin of the wave. |
Returns
Distort
The wave distortion function.