Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

readme.md

voxel-perlin-terrain

generate voxel terrain using perlin noise

this is designed to work out of the box with voxel-engine

install

npm install voxel-perlin-terrain

api

var terrain = require('voxel-perlin-terrain')
var chunkSize = 32

// initialize your noise with a seed, floor height, ceiling height and scale factor
var generateChunk = terrain('foo', 0, 5, 20)

// then hook it up to your game as such:

game.voxels.on('missingChunk', function(p) {
  var voxels = generateChunk(p, chunkSize)
  var chunk = {
    position: p,
    dims: [chunkSize, chunkSize, chunkSize],
    voxels: voxels
  }
  game.showChunk(chunk)
})

// note that your game should have generateChunks: false

chunk data is returned in the format of the voxel module

license

BSD

About

generate voxel terrain using perlin smooth noise

Resources

Releases

No releases published

Packages

No packages published