Skip to content

incompl/voxel-heightmap-terrain

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

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

voxel-heightmap-terrain

generate voxel terrain using a png heightmap

example

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

heightmaps

The generator uses heightmaps in JSON form

This repo includes png2json.js which lets you create these JSON files from PNG images

node png2json dog.png

demo

clone this repo

run make

serve eg python -m SimpleHTTPServer 8080

install

npm install voxel-heightmap-terrain

api

var generator = require('voxel-heightmap-terrain');
var heightmap = require('./heightmap.json');

window.game = createGame({
  generate: function(x, y, z) {
    return generator(x, y, z, heightmap);
  },
  ...
});

license

MIT

About

generate voxel terrain using a png heightmap

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published