🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

three-noise

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

three-noise

Simple gradient noise library for use with Three.js. Now with fBm!

latest
Source
npmnpm
Version
1.1.2
Version published
Weekly downloads
885
86.32%
Maintainers
1
Weekly downloads
 
Created
Source

THREE-Noise

Simple gradient noise library for use with Three.js. Now with fBm!
View Demo · Report Bug · API Docs

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

Keywords

threejs

FAQs

Package last updated on 09 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts