| opensimplex_noise | R Documentation |
Create a regular n-dimensional grid with an OpenSimplex2 noise gradient.
You can control the noisiness to some degree with the frequency argument.
If you want more control, you should use opensimplex_space(), which
allows you to create a continuous OpenSimplex noise gradient space,
that can be sampled at any arbitrary coordinate.
opensimplex_noise(type = "S", width, height, depth, slice, frequency = 1)
type |
Type of OpenSimplex2 you wish to use. Should be either
|
width, height, depth, slice |
Positive |
frequency |
The frequency ( |
The exact state of the noise gradient space depends on R's internal, random generator. So each time you call opensimplex_space, you will get a, space in a different state. If you want to obtain a reproducible state,, you simply set the random seed with set.seed().
A matrix (in case of two dimensions) or array (in case of more
dimensions) of numeric values between -1 and +1. OpenSimplex2 uses
gradient tables that ensure that the distribution of values is centred at zero,
meaning the "peaks" and "valleys" are statistically balanced.
mat <- opensimplex_noise("S", 100, 100)
image(mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.