Open this page at https://ch3mbot.github.io/pxt-noise/
This extension adds several noise generators. Currently only javascript is supported.
- 1D Perlin noise
- 1D Perlin noise with hash function
- 2D Perlin noise
- 2D Perlin noise with hash function
- 2D open simplex noise
This repository can be added as an extension in MakeCode.
- open https://arcade.makecode.com/
- click on New Project
- click on Extensions under the gearwheel menu
- search for https://github.com/ch3mbot/pxt-noise and import
How to initialize a noise generator and sample it:
let generator = new noise.OpenSimplexNoise2D();
let value = generator.noise(x, y);The default seed is 0. When seed is set to 0 the default permutation table is used.
How to initialize a noise generator with a seed:
let generator = new noise.PerlinNoise1D(12345);
The perlin noise generators can optionally be given an interpolation function:
let generator = new noise.PerlinNoise2D(0, noise.interpolate2DQuint);The default interpolation function is cubic interpolation. Quintic is slower but smoother, while linear is fast but jagged.
To edit this repository in MakeCode.
- open https://arcade.makecode.com/
- click on Import then click on Import URL
- paste https://github.com/ch3mbot/pxt-noise and click import
- 3D noise
- 4D noise?
- Test 1D Perlin noise with hash function
- 2D worley noise
- for PXT/arcade