Instance Method

remapValuesToCurveWithControlPoints:

Replaces values in the noise field by mapping them to a curve that passes through the specified control points.

Declaration

- (void)remapValuesToCurveWithControlPoints:(NSDictionary<NSNumber *,NSNumber *> *)controlPoints;

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.

Figure 1

Example result of the remapValuesToCurve operation

See Also

Applying Operations to Noise Values

- applyAbsoluteValue

Replaces all negative values in the noise field with their positive absolute values.

- invert

Replaces all values in the noise field with their opposite, reversing the range of noise values.

- raiseToPower:

Replaces all values in the noise field by raising each value to the specified power.

- clampWithLowerBound:upperBound:

Replaces values in the noise field outside the specified range with the values at the endpoints of that range.

- remapValuesToTerracesWithPeaks:terracesInverted:

Replaces values in the noise field by mapping them to a terrace-like curve that passes through the specified control points.