three-terrain

0.0.10 • Public • Published

three-terrain

screenshot

A fast heightmap based voxelizer

Examples

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);

Readme

Keywords

none

Package Sidebar

Install

npm i three-terrain

Weekly Downloads

7

Version

0.0.10

License

MIT

Unpacked Size

24.9 kB

Total Files

3

Last publish

Collaborators

  • danielesteban