three-terrain
v0.0.10
Published
[three-terrain](https://terrain.gatunes.com/) ==
Downloads
5
Readme
three-terrain
A fast heightmap based voxelizer
Examples
- three-terrain.glitch.me (source)
- three-terrain-generator.glitch.me (source)
- three-terrain-walk.glitch.me (source)
Installation
npm install three-terrain
Usage
import { Scene } from 'three';
import Terrain from 'three-terrain';
const terrain = new Terrain({
width: 640,
height: 255,
depth: 640,
maps: {
colorRGBheightAlpha: '/terrain.png',
/*
colorRGB: colormap from image RGB
colorRGBheightAlpha: colormap from image RGB + heightmap from alpha channel
colorRGBheightRGB: colormap from RGB + heightmap from RGB grayscale
heightAlpha: heightmap from image alpha channel
heightR: heightmap from image red channel
heightRGB: heightmap from image RGB grayscale
*/
},
});
const scene = new Scene();
scene.add(terrain);