remapValues(toCurveWithControlPoints:)
Replaces values in the noise field by mapping them to a curve that passes through the specified control points.
Declaration
func remapValues(toCurveWithControlPoints controlPoints: [NSNumber : NSNumber])Parameters
- controlPoints:
A dictionary whose keys are input values in the existing noise, and whose values are the output values to replace the input values with.
Discussion
When you call this method, the GKNoise class first interpolates the values specified in the controlPoints parameter to create a smooth curve. Then, this method uses the curve to replace values in the noise field. For example, passing the control points [-1.0: -1.0, -0.5: 0.5, 0.5: -0.5, 1.0: 1.0] defines an S-shaped curve that leaves the lowest and highest values in the noise field unchanged, but replaces moderately low values with moderately high values and vice versa.
[Image]