1.1.2 • Published 2 years ago

three-noise v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Installation

Make sure to have ThreeJS installed.

$ npm i three

Install through NPM

$ npm i three-noise

For Browsers, download build/three-noise.js.

Importing

Browser

In your HTML

<script src="lib/three-noise.js"></script>
<script src="./main.js" defer></script>

Then, in your JavaScript you can use the THREE_Noise object.

const { Perlin, FBM } = THREE_Noise;

NodeJS

In NodeJS, you can import it like you normally do.

import { Perlin, FBM } from 'THREE_Noise';

Usage

Perlin

// Instantiate the class with a seed
const perlin = new Perlin(Math.random())

perlin.get2(vector2)   // Get 2D Perlin Nosie
perlin.get3(vector3)   // Get 3D Perlin Nosie

fBm

// Instantiate the class with a seed
const fbm = new FBM({
    seed: Math.random()
})

fbm.get(vector2)      // Get 2D Perlin Nosie with fBm
fbm.get(vector3)      // Get 3D Perlin Nosie with fBm
1.1.1

2 years ago

1.1.2

2 years ago

1.1.0

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago