View on GitHub

pxt-noise

A MakeCode project

Open this page at https://ch3mbot.github.io/pxt-noise/

Description

This extension adds several noise generators. Currently only javascript is supported.

Noise Generators

1D

2D

Use as Extension

This repository can be added as an extension in MakeCode.

Usage Examples

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.

Edit this project

To edit this repository in MakeCode.

TODO

Metadata (used for search, rendering)