generate voxel terrain using a png heightmap
Switch branches/tags
Nothing to show
Clone or download
Greg
Latest commit cfe0087 Jan 23, 2013
Permalink
Failed to load latest commit information.
textures initial commit Jan 22, 2013
.gitignore adding deps Jan 22, 2013
Makefile initial commit Jan 22, 2013
README.md adding cool demo image Jan 22, 2013
demo.js initial commit Jan 22, 2013
example.png adding deps Jan 22, 2013
greg.png initial commit Jan 22, 2013
heightmap.json initial commit Jan 22, 2013
heightmap.png initial commit Jan 22, 2013
index.html initial commit Jan 22, 2013
index.js initial commit Jan 22, 2013
package.json adding deps Jan 22, 2013
png2json.js initial commit Jan 22, 2013

README.md

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