Difference between revisions of "love.math.noise"

(Created page)
 
m (Edited return value description to match new range of [0, 1])
Line 14: Line 14:
 
{{param|number|x|The number used to generate the noise value.}}
 
{{param|number|x|The number used to generate the noise value.}}
 
=== Returns ===
 
=== Returns ===
{{param|number|value|The noise value in the range of [-1, +1].}}
+
{{param|number|value|The noise value in the range of [0, 1].}}
 
== Function ==
 
== Function ==
 
Generates Simplex noise from 2 dimensions.
 
Generates Simplex noise from 2 dimensions.
Line 25: Line 25:
 
{{param|number|y|The second value of the 2-dimensional vector used to generate the noise value.}}
 
{{param|number|y|The second value of the 2-dimensional vector used to generate the noise value.}}
 
=== Returns ===
 
=== Returns ===
{{param|number|value|The noise value in the range of [-1, +1].}}
+
{{param|number|value|The noise value in the range of [0, 1].}}
 
== Function ==
 
== Function ==
 
Generates Simplex noise from 3 dimensions.
 
Generates Simplex noise from 3 dimensions.
Line 37: Line 37:
 
{{param|number|z|The third value of the 3-dimensional vector used to generate the noise value.}}
 
{{param|number|z|The third value of the 3-dimensional vector used to generate the noise value.}}
 
=== Returns ===
 
=== Returns ===
{{param|number|value|The noise value in the range of [-1, +1].}}
+
{{param|number|value|The noise value in the range of [0, 1].}}
 
== Function ==
 
== Function ==
 
Generates Simplex noise from 4 dimensions.
 
Generates Simplex noise from 4 dimensions.
Line 50: Line 50:
 
{{param|number|w|The fourth value of the 4-dimensional vector used to generate the noise value.}}
 
{{param|number|w|The fourth value of the 4-dimensional vector used to generate the noise value.}}
 
=== Returns ===
 
=== Returns ===
{{param|number|value|The noise value in the range of [-1, +1].}}
+
{{param|number|value|The noise value in the range of [0, 1].}}
 
== See Also ==
 
== See Also ==
 
* [[parent::love.math]]
 
* [[parent::love.math]]

Revision as of 22:58, 19 August 2013

Available since LÖVE 0.9.0
This function is not supported in earlier versions.

Generates a Simplex noise value in 1-4 dimensions.

Simplex noise is closely related to Perlin noise. It is widely used for procedural content generation.

There are many webpages which discuss Perlin and Simplex noise in detail.

Function

Generates Simplex noise from 1 dimension.

Synopsis

value = love.math.noise( x )

Arguments

number x
The number used to generate the noise value.

Returns

number value
The noise value in the range of [0, 1].

Function

Generates Simplex noise from 2 dimensions.

Synopsis

value = love.math.noise( x, y )

Arguments

number x
The first value of the 2-dimensional vector used to generate the noise value.
number y
The second value of the 2-dimensional vector used to generate the noise value.

Returns

number value
The noise value in the range of [0, 1].

Function

Generates Simplex noise from 3 dimensions.

Synopsis

value = love.math.noise( x, y, z )

Arguments

number x
The first value of the 3-dimensional vector used to generate the noise value.
number y
The second value of the 3-dimensional vector used to generate the noise value.
number z
The third value of the 3-dimensional vector used to generate the noise value.

Returns

number value
The noise value in the range of [0, 1].

Function

Generates Simplex noise from 4 dimensions.

Synopsis

value = love.math.noise( x, y, z, w )

Arguments

number x
The first value of the 4-dimensional vector used to generate the noise value.
number y
The second value of the 4-dimensional vector used to generate the noise value.
number z
The third value of the 4-dimensional vector used to generate the noise value.
number w
The fourth value of the 4-dimensional vector used to generate the noise value.

Returns

number value
The noise value in the range of [0, 1].

See Also

Other Languages