Module. Collects utility functions useful for custom patterns.
Function. Adjusts the parameters of a texture generator, by collecting values provided by the user and the default values of the generator. Then creates a texture. Returns the texture. This function is used internally by the texture generators.
retexture( opt, defaults, options, pattern )
where:
opt
– user-defined parameters (object)defaults
– default values for the user-defined parameters (object)options
– pattern-specifix function that compiles the parameters (function)pattern
– texture pattern function (function)Function. Calculates linear mapping of a value from one interval (called input) to another interval (called output). Returnes the mapped value.
map( x )
map( x, toMin, toMax )
map( x, toMin, toMax, fromMin, fromMax )
where:
x
– value to be mapped (number)toMin
– lower bound of output interval (number, default 0)toMax
– upper bound of output interval (number, default 1)fromMin
– lower bound of input interval (number, default 0)fromMax
– upper bound of input interval (number, default 100)Note: Function map is similar to THREE.MathUtils.mapLinear but the intervals are swapped.
Function. Calculates exponential mapping of a value from one interval (called input) to another interval (called output). Returnes the mapped value.
mapExp( x )
mapExp( x, toMin, toMax )
mapExp( x, toMin, toMax, fromMin, fromMax )
where:
x
– value to be mapped (number)toMin
– lower bound of output interval (number, default 0)toMax
– upper bound of output interval (number, default 1)fromMin
– lower bound of input interval (number, default 0)fromMax
– upper bound of input interval (number, default 100)